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)
19 function staticGet($k,$v=null)
20 { return Memcached_DataObject::staticGet('Reply',$k,$v); }
22 /* the code above is auto generated do not remove the tag below */
25 public static function schemaDef()
29 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice that is the reply'),
30 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'profile replied to'),
31 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
32 'replied_id' => array('type' => 'int', 'description' => 'notice replied to (not used, see notice.reply_to)'),
34 'primary key' => array('notice_id', 'profile_id'),
35 'foreign keys' => array(
36 'reply_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
37 'reply_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
40 'reply_notice_id_idx' => array('notice_id'),
41 'reply_profile_id_idx' => array('profile_id'),
42 'reply_replied_id_idx' => array('replied_id'),
49 return Memcached_DataObject::pkeyGet('Reply',$kv);
53 * Wrapper for record insertion to update related caches
57 $result = parent::insert();
60 self::blow('reply:stream:%d', $this->profile_id);
66 function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
68 $stream = new ReplyNoticeStream($user_id);
70 return $stream->getNotices($offset, $limit, $since_id, $max_id);