X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice_inbox.php;h=2dc75959a41c20d2f57517605c4b6e425e44371c;hb=59744937077b51c8ff1e43d9cc386a90fb06463d;hp=c27dcdfd616079359df0f4db998f7c09ca285537;hpb=fdb64eed2f1d24ad38fe4a6bc680e3592647c0a6;p=quix0rs-gnu-social.git diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php index c27dcdfd61..2dc75959a4 100644 --- a/classes/Notice_inbox.php +++ b/classes/Notice_inbox.php @@ -31,7 +31,7 @@ define('NOTICE_INBOX_GC_MAX', 12800); define('NOTICE_INBOX_LIMIT', 1000); define('NOTICE_INBOX_SOFT_LIMIT', 1000); -class Notice_inbox extends Memcached_DataObject +class Notice_inbox extends Managed_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ @@ -42,26 +42,38 @@ class Notice_inbox extends Memcached_DataObject public $created; // datetime() not_null public $source; // tinyint(1) default_1 - /* Static get */ - function staticGet($k,$v=null) - { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); } - /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - function stream($user_id, $offset, $limit, $since_id, $max_id, $since, $own=false) + public static function schemaDef() { - throw new Exception('Notice_inbox no longer used; use Inbox'); + return array( + 'description' => 'Obsolete; old entries here are converted to packed entries in the inbox table since 0.9', + 'fields' => array( + 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user receiving the message'), + 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'notice received'), + 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date the notice was created'), + 'source' => array('type' => 'int', 'size' => 'tiny', 'default' => 1, 'description' => 'reason it is in the inbox, 1=subscription'), + ), + 'primary key' => array('user_id', 'notice_id'), + 'foreign keys' => array( + 'notice_inbox_user_id_fkey' => array('user', array('user_id' => 'id')), + 'notice_inbox_notice_id_fkey' => array('notice', array('notice_id' => 'id')), + ), + 'indexes' => array( + 'notice_inbox_notice_id_idx' => array('notice_id'), + ), + ); } - function _streamDirect($user_id, $own, $offset, $limit, $since_id, $max_id, $since) + function stream($user_id, $offset, $limit, $since_id, $max_id, $own=false) { throw new Exception('Notice_inbox no longer used; use Inbox'); } - function &pkeyGet($kv) + function _streamDirect($user_id, $own, $offset, $limit, $since_id, $max_id) { - return Memcached_DataObject::pkeyGet('Notice_inbox', $kv); + throw new Exception('Notice_inbox no longer used; use Inbox'); } static function gc($user_id)