X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fconversationnoticestream.php;fp=lib%2Fconversationnoticestream.php;h=b26e898612cd5d86e4a1b9fc293de4a2b4056be2;hb=44bcc942b874c742a079fb1b18cac834bf96c986;hp=0000000000000000000000000000000000000000;hpb=e0cccfc40d9789408cc427c1de8822ab7b7a9765;p=quix0rs-gnu-social.git diff --git a/lib/conversationnoticestream.php b/lib/conversationnoticestream.php new file mode 100644 index 0000000000..b26e898612 --- /dev/null +++ b/lib/conversationnoticestream.php @@ -0,0 +1,52 @@ +id = $id; + } + + function getNoticeIds($offset=0, $limit=20, $since_id=0, $max_id=0) + { + $notice = new Notice(); + + $notice->selectAdd(); // clears it + $notice->selectAdd('id'); + + $notice->conversation = $this->id; + + $notice->orderBy('created DESC, id DESC'); + + if (!is_null($offset)) { + $notice->limit($offset, $limit); + } + + Notice::addWhereSinceId($notice, $since_id); + Notice::addWhereMaxId($notice, $max_id); + + $ids = array(); + + if ($notice->find()) { + while ($notice->fetch()) { + $ids[] = $notice->id; + } + } + + $notice->free(); + $notice = NULL; + + return $ids; + } +} \ No newline at end of file