git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 18fe1ac5 authored by Evan Prodromou's avatar Evan Prodromou

Revert "Revert "use Notice::multiGet() for NoticeStream::getStreamByIds()""

This reverts commit b1c12648.
parent b1c12648
......@@ -59,42 +59,6 @@ abstract class NoticeStream
static function getStreamByIds($ids)
{
$cache = Cache::instance();
if (!empty($cache)) {
$notices = array();
foreach ($ids as $id) {
$n = Notice::staticGet('id', $id);
if (!empty($n)) {
$notices[] = $n;
}
}
return new ArrayWrapper($notices);
} else {
$notice = new Notice();
if (empty($ids)) {
//if no IDs requested, just return the notice object
return $notice;
}
$notice->whereAdd('id in (' . implode(', ', $ids) . ')');
$notice->find();
$temp = array();
while ($notice->fetch()) {
$temp[$notice->id] = clone($notice);
}
$wrapped = array();
foreach ($ids as $id) {
if (array_key_exists($id, $temp)) {
$wrapped[] = $temp[$id];
}
}
return new ArrayWrapper($wrapped);
}
return Notice::multiGet('id', $ids);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment