From 18fe1ac5240b60e89218c5c8ff8d0bf65b790730 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 14 Jul 2011 13:15:28 -0400 Subject: [PATCH] Revert "Revert "use Notice::multiGet() for NoticeStream::getStreamByIds()"" This reverts commit b1c12648f06332afe7007d61ec1b8c5060c35133. --- lib/noticestream.php | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/lib/noticestream.php b/lib/noticestream.php index be28aa6186..e9ff47b68c 100644 --- a/lib/noticestream.php +++ b/lib/noticestream.php @@ -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); } } -- 2.39.5