3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2008, 2009, StatusNet, Inc.
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.
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.
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/>.
20 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
22 class Notice_tag extends Memcached_DataObject
25 /* the code below is auto generated do not remove the above tag */
27 public $__table = 'notice_tag'; // table name
28 public $tag; // varchar(64) primary_key not_null
29 public $notice_id; // int(4) primary_key not_null
30 public $created; // datetime() not_null
33 function staticGet($k,$v=null)
34 { return Memcached_DataObject::staticGet('Notice_tag',$k,$v); }
36 /* the code above is auto generated do not remove the tag below */
39 static function getStream($tag, $offset=0, $limit=20, $sinceId=0, $maxId=0)
41 $stream = new TagNoticeStream($tag);
43 return $stream->getNotices($offset, $limit, $sinceId, $maxId);
46 function blowCache($blowLast=false)
48 self::blow('notice_tag:notice_ids:%s', Cache::keyize($this->tag));
50 self::blow('notice_tag:notice_ids:%s;last', Cache::keyize($this->tag));
56 return Memcached_DataObject::pkeyGet('Notice_tag', $kv);
59 static function url($tag)
61 if (common_config('singleuser', 'enabled')) {
62 // regular TagAction isn't set up in 1user mode
63 $nickname = User::singleUserNickname();
64 $url = common_local_url('showstream',
65 array('nickname' => $nickname,
68 $url = common_local_url('tag', array('tag' => $tag));