DB_DATAOBJECT_INT, 'tagger_id' => DB_DATAOBJECT_INT, 'object_id' => DB_DATAOBJECT_INT, 'tagged_on' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME, ); } // now define the keys. function keys() { return array('tag_id', 'tagger_id', 'object_id'); } } class DB_DataObject_tags extends DB_DataObject { // you can define these yourself var $__table='freetags'; // table name var $id; var $tag; var $raw_tag; // these are usefull to be consistant with a autogenerated file. /* Static get */ function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Punch',$k,$v); } // now define your table structure. // key is column name, value is type function table() { return array( 'id' => DB_DATAOBJECT_INT, 'tag' => DB_DATAOBJECT_STR, 'raw_tag' => DB_DATAOBJECT_STR, ); } // now define the keys. function keys() { return array('id'); } }