]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Revert "Revert "use Notice::multiGet() for NoticeStream::getStreamByIds()""
authorEvan Prodromou <evan@status.net>
Thu, 14 Jul 2011 17:15:28 +0000 (13:15 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 14 Jul 2011 17:15:28 +0000 (13:15 -0400)
This reverts commit b1c12648f06332afe7007d61ec1b8c5060c35133.

lib/noticestream.php

index be28aa61867526f56214ca9ed7f9f6b9534e20a7..e9ff47b68c154eb73641cbaf97dbb1b0126c2cae 100644 (file)
@@ -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);
     }
 }