- $cache = common_memcache();
- if ($cache) {
- $cache->delete(common_cache_key('notice_tag:notice_stream:' . $this->tag));
+ $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);