abstract function filter($notice);
- function getNotices($offset, $limit, $sinceId, $maxId)
+ function getNotices($offset, $limit, $sinceId=null, $maxId=null)
{
// "offset" is virtual; we have to get a lot
$total = $offset + $limit;
break;
}
- while ($raw->fetch()) {
- if ($this->filter($raw)) {
- $filtered[] = clone($raw);
- if (count($filtered >= $total)) {
+ $notices = $raw->fetchAll();
+
+ // XXX: this should probably only be in the scoping one.
+
+ Notice::fillGroups($notices);
+ Notice::fillReplies($notices);
+
+ foreach ($notices as $notice) {
+ if ($this->filter($notice)) {
+ $filtered[] = $notice;
+ if (count($filtered) >= $total) {
break;
}
}
$ids = array();
while ($notices->fetch()) {
- $ids[] = $notice->id;
+ $ids[] = $notices->id;
}
return $ids;