3 class GroupNoticeStream extends CachingNoticeStream
5 function __construct($group)
7 parent::__construct(new RawGroupNoticeStream($group),
8 'user_group:notice_ids:' . $group->id);
12 class RawGroupNoticeStream extends NoticeStream
16 function __construct($group)
18 $this->group = $group;
21 function getNoticeIds($offset, $limit, $since_id, $max_id)
23 $inbox = new Group_inbox();
25 $inbox->group_id = $this->group->id;
28 $inbox->selectAdd('notice_id');
30 Notice::addWhereSinceId($inbox, $since_id, 'notice_id');
31 Notice::addWhereMaxId($inbox, $max_id, 'notice_id');
33 $inbox->orderBy('created DESC, notice_id DESC');
35 if (!is_null($offset)) {
36 $inbox->limit($offset, $limit);
42 while ($inbox->fetch()) {
43 $ids[] = $inbox->notice_id;