X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice_tag.php;h=9ade36c34a7dfc0cdf0e8a63b548b3db6f643724;hb=59119482ca34540bd7f0a2a1aa994de1d5328ea2;hp=8c3911f7642fdfbb3f334632da14963b3c711f1c;hpb=eb2f9c98ac115ce67e9a740b200c832153ffa05c;p=quix0rs-gnu-social.git diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index 8c3911f764..9ade36c34a 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -1,7 +1,7 @@ delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); + + function _streamDirect($tag, $offset, $limit, $since_id, $max_id) + { + $nt = new Notice_tag(); + + $nt->tag = $tag; + + $nt->selectAdd(); + $nt->selectAdd('notice_id'); + + if ($since_id != 0) { + $nt->whereAdd('notice_id > ' . $since_id); + } + + if ($max_id != 0) { + $nt->whereAdd('notice_id < ' . $max_id); } + + $nt->orderBy('notice_id DESC'); + + if (!is_null($offset)) { + $nt->limit($offset, $limit); + } + + $ids = array(); + + if ($nt->find()) { + while ($nt->fetch()) { + $ids[] = $nt->notice_id; + } + } + + return $ids; + } + + function blowCache($blowLast=false) + { + self::blow('notice_tag:notice_ids:%s', Cache::keyize($this->tag)); + if ($blowLast) { + self::blow('notice_tag:notice_ids:%s;last', Cache::keyize($this->tag)); + } + } + + function pkeyGet($kv) + { + return Memcached_DataObject::pkeyGet('Notice_tag', $kv); } }