X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice_tag.php;h=5b75ff13feb05a22bf48596ac5d73fdaf69f1759;hb=1e8d26baecad6ca1088ea7815fe2615fb520a10e;hp=7f950d946386b85c7185a0a0a519b84c7b01a772;hpb=8da61dc1d36e2ac600a50450038ce69d458b0e7b;p=quix0rs-gnu-social.git diff --git a/classes/Notice_tag.php b/classes/Notice_tag.php index 7f950d9463..5b75ff13fe 100644 --- a/classes/Notice_tag.php +++ b/classes/Notice_tag.php @@ -1,7 +1,22 @@ . */ + require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; class Notice_tag extends Memcached_DataObject @@ -19,4 +34,22 @@ class Notice_tag extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + static function getStream($tag, $offset=0, $limit=20) { + $qry = + 'SELECT notice.* ' . + 'FROM notice JOIN notice_tag ON notice.id = notice_tag.notice_id ' . + 'WHERE notice_tag.tag = "%s" '; + + return Notice::getStream(sprintf($qry, $tag), + 'notice_tag:notice_stream:' . common_keyize($tag), + $offset, $limit); + } + + function blowCache() { + $cache = common_memcache(); + if ($cache) { + $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag)); + } + } }