X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fnoticestream.php;h=e9ff47b68c154eb73641cbaf97dbb1b0126c2cae;hb=5eba1030ae39038b7b6b0aad5de1043fae43e48d;hp=b60fc236f706e60e34ffa8d57bf4999ea61f8ceb;hpb=22bf63bb469327f77708d734d7277274ed4735ef;p=quix0rs-gnu-social.git diff --git a/lib/noticestream.php b/lib/noticestream.php index b60fc236f7..e9ff47b68c 100644 --- a/lib/noticestream.php +++ b/lib/noticestream.php @@ -46,9 +46,9 @@ if (!defined('STATUSNET')) { */ abstract class NoticeStream { - abstract function getNoticeIds($offset, $limit, $sinceId, $maxId); + abstract function getNoticeIds($offset, $limit, $since_id, $max_id); - function getNotices($offset=0, $limit=20, $sinceId=0, $maxId=0) + function getNotices($offset, $limit, $sinceId = null, $maxId = null) { $ids = $this->getNoticeIds($offset, $limit, $sinceId, $maxId); @@ -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); } }