]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/Notice_inbox.php
Merge branch 'inblob' of git@gitorious.org:~evan/statusnet/evans-mainline into inblob
[quix0rs-gnu-social.git] / classes / Notice_inbox.php
1 <?php
2 /*
3  * StatusNet - the distributed open-source microblogging tool
4  * Copyright (C) 2008-2010, StatusNet, Inc.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Affero General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Affero General Public License for more details.
15  *
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 if (!defined('STATUSNET')) {
21     exit(1);
22 }
23
24 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
25
26 // We keep 5 pages of inbox notices in memcache, +1 for pagination check
27
28 define('INBOX_CACHE_WINDOW', 101);
29 define('NOTICE_INBOX_GC_BOXCAR', 128);
30 define('NOTICE_INBOX_GC_MAX', 12800);
31 define('NOTICE_INBOX_LIMIT', 1000);
32 define('NOTICE_INBOX_SOFT_LIMIT', 1000);
33
34 define('NOTICE_INBOX_SOURCE_SUB', 1);
35 define('NOTICE_INBOX_SOURCE_GROUP', 2);
36 define('NOTICE_INBOX_SOURCE_REPLY', 3);
37 define('NOTICE_INBOX_SOURCE_FORWARD', 4);
38 define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
39
40 class Notice_inbox extends Memcached_DataObject
41 {
42     ###START_AUTOCODE
43     /* the code below is auto generated do not remove the above tag */
44
45     public $__table = 'notice_inbox';                    // table name
46     public $user_id;                         // int(4)  primary_key not_null
47     public $notice_id;                       // int(4)  primary_key not_null
48     public $created;                         // datetime()   not_null
49     public $source;                          // tinyint(1)   default_1
50
51     /* Static get */
52     function staticGet($k,$v=null)
53     { return Memcached_DataObject::staticGet('Notice_inbox',$k,$v); }
54
55     /* the code above is auto generated do not remove the tag below */
56     ###END_AUTOCODE
57
58     function stream($user_id, $offset, $limit, $since_id, $max_id, $since, $own=false)
59     {
60         throw new Exception('Notice_inbox no longer used; use Inbox');
61     }
62
63     function _streamDirect($user_id, $own, $offset, $limit, $since_id, $max_id, $since)
64     {
65         throw new Exception('Notice_inbox no longer used; use Inbox');
66     }
67
68     function &pkeyGet($kv)
69     {
70         return Memcached_DataObject::pkeyGet('Notice_inbox', $kv);
71     }
72
73     static function gc($user_id)
74     {
75         throw new Exception('Notice_inbox no longer used; use Inbox');
76     }
77
78     static function deleteMatching($user_id, $notices)
79     {
80         throw new Exception('Notice_inbox no longer used; use Inbox');
81     }
82
83     static function bulkInsert($notice_id, $created, $ni)
84     {
85         throw new Exception('Notice_inbox no longer used; use Inbox');
86     }
87 }