public $__table = 'fave_tally'; // table name
public $notice_id; // int(4) primary_key not_null
public $count; // int(4) not_null
+ public $created; // datetime() not_null
public $modified; // datetime not_null default_0000-00-00%2000%3A00%3A00
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- /**
- * return table definition for DB_DataObject
- *
- * @return array array of column definitions
- */
-
- function table()
+ public static function schemaDef()
{
return array(
- 'notice_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
- 'count' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
- 'modified' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL
+ 'fields' => array(
+ 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice id'),
+ 'count' => array('type' => 'int', 'not null' => true, 'description' => 'the fave tally count'),
+ 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
+ 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
+ ),
+ 'primary key' => array('notice_id'),
+ 'foreign keys' => array(
+ 'fave_tally_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
+ ),
);
}
- /**
- * return key definitions for DB_DataObject
- *
- * DB_DataObject needs to know about keys that the table has, since it
- * won't appear in StatusNet's own keys list. In most cases, this will
- * simply reference your keyTypes() function.
- *
- * @return array list of key field names
- */
- function keys()
- {
- return array_keys($this->keyTypes());
- }
-
- /**
- * return key definitions for Memcached_DataObject
- *
- * Our caching system uses the same key definitions, but uses a different
- * method to get them. This key information is used to store and clear
- * cached data, so be sure to list any key that will be used for static
- * lookups.
- *
- * @return array associative array of key definitions, field name to type:
- * 'K' for primary key: for compound keys, add an entry for each component;
- * 'U' for unique keys: compound keys are not well supported here.
- */
- function keyTypes()
- {
- return array('notice_id' => 'K');
- }
-
- /**
- * Magic formula for non-autoincrementing integer primary keys
- *
- * If a table has a single integer column as its primary key, DB_DataObject
- * assumes that the column is auto-incrementing and makes a sequence table
- * to do this incrementation. Since we don't need this for our class, we
- * overload this method and return the magic formula that DB_DataObject needs.
- *
- * @return array magic three-false array that stops auto-incrementing.
- */
- function sequenceKey()
- {
- return array(false, false, false);
- }
-
/**
* Increment a notice's tally
*