- /**
- * Get the TableDef object that represents the table backing this class
- * @return TableDef TableDef instance
- */
- function tableDef()
+ function table()
+ {
+ $db = $this->getDatabaseConnection();
+ $dbtype = $db->phptype; // Database type is stored here. Crazy but true.
+
+ return array('trustroot' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
+ 'user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
+ 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL,
+ 'modified' => ($dbtype == 'mysql' || $dbtype == 'mysqli') ?
+ DB_DATAOBJECT_MYSQLTIMESTAMP + DB_DATAOBJECT_NOTNULL :
+ DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME
+ );
+ }
+
+ function keys()