3 class RawBookmarksNoticeStream extends NoticeStream
8 function __construct($user_id, $own)
10 $this->user_id = $user_id;
14 function getNoticeIds($offset, $limit, $since_id, $max_id)
16 $notice = new Notice();
19 $qry = 'SELECT notice.* FROM notice ';
20 $qry .= 'INNER JOIN bookmark ON bookmark.uri = notice.uri ';
21 $qry .= 'WHERE bookmark.profile_id = ' . $this->user_id . ' ';
22 $qry .= 'AND notice.is_local != ' . Notice::GATEWAY . ' ';
25 $qry .= 'AND notice.id > ' . $since_id . ' ';
29 $qry .= 'AND notice.id <= ' . $max_id . ' ';
32 // NOTE: we sort by bookmark time, not by notice time!
33 $qry .= 'ORDER BY created DESC ';
34 if (!is_null($offset)) {
35 $qry .= "LIMIT $limit OFFSET $offset";
40 while ($notice->fetch()) {
51 * Notice stream for bookmarks
55 * @author Stephane Berube <chimo@chromic.org>
56 * @copyright 2011 StatusNet, Inc.
57 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
58 * @link http://status.net/
61 class BookmarksNoticeStream extends ScopingNoticeStream
63 function __construct($user_id, $own, $profile = -1)
65 $stream = new RawBookmarksNoticeStream($user_id, $own);
68 $key = 'bookmark:ids_by_user_own:'.$user_id;
70 $key = 'bookmark:ids_by_user:'.$user_id;
73 if (is_int($profile) && $profile == -1) {
74 $profile = Profile::current();
77 parent::__construct(new CachingNoticeStream($stream, $key),