]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice_tag.php
better output for registration confirmation
[quix0rs-gnu-social.git] / classes / Notice_tag.php
index f795bfc601cfc6765afc121fa417f7f652893137..809403a9bd99ac89be0785ad0e1c01655f15d307 100644 (file)
@@ -36,50 +36,18 @@ 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) {
-
-        $ids = Notice::stream(array('Notice_tag', '_streamDirect'),
-                              array($tag),
-                              'notice_tag:notice_ids:' . common_keyize($tag),
-                              $offset, $limit);
-
-        return Notice::getStreamByIds($ids);
-    }
-
-    function _streamDirect($tag, $offset, $limit, $since_id, $max_id)
+    static function getStream($tag, $offset=0, $limit=20, $sinceId=0, $maxId=0)
     {
-        $nt = new Notice_tag();
-
-        $nt->tag = $tag;
-
-        $nt->selectAdd();
-        $nt->selectAdd('notice_id');
-
-        Notice::addWhereSinceId($nt, $since_id, 'notice_id');
-        Notice::addWhereMaxId($nt, $max_id, 'notice_id');
-
-        $nt->orderBy('created DESC, 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;
+        $stream = new TagNoticeStream($tag);
+        
+        return $stream->getNotices($offset, $limit, $sinceId, $maxId);
     }
 
     function blowCache($blowLast=false)
     {
-        self::blow('notice_tag:notice_ids:%s', common_keyize($this->tag));
+        self::blow('notice_tag:notice_ids:%s', Cache::keyize($this->tag));
         if ($blowLast) {
-            self::blow('notice_tag:notice_ids:%s;last', common_keyize($this->tag));
+            self::blow('notice_tag:notice_ids:%s;last', Cache::keyize($this->tag));
         }
     }