3 * Table Definition for reply
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
7 class Reply extends Managed_DataObject
10 /* the code below is auto generated do not remove the above tag */
12 public $__table = 'reply'; // table name
13 public $notice_id; // int(4) primary_key not_null
14 public $profile_id; // int(4) primary_key not_null
15 public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
16 public $replied_id; // int(4)
18 /* the code above is auto generated do not remove the tag below */
21 public static function schemaDef()
25 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice that is the reply'),
26 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'profile replied to'),
27 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
28 'replied_id' => array('type' => 'int', 'description' => 'notice replied to (not used, see notice.reply_to)'),
30 'primary key' => array('notice_id', 'profile_id'),
31 'foreign keys' => array(
32 'reply_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
33 'reply_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
36 'reply_notice_id_idx' => array('notice_id'),
37 'reply_profile_id_idx' => array('profile_id'),
38 'reply_replied_id_idx' => array('replied_id'),
39 'reply_profile_id_modified_notice_id_idx' => array('profile_id', 'modified', 'notice_id')
45 * Wrapper for record insertion to update related caches
49 $result = parent::insert();
52 self::blow('reply:stream:%d', $this->profile_id);
58 static function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
60 $stream = new ReplyNoticeStream($user_id);
61 return $stream->getNotices($offset, $limit, $since_id, $max_id);