reorder notices when not using memcached

This commit is contained in:
Evan Prodromou 2009-12-08 21:02:54 -05:00
parent 21757186e9
commit 45408142e9

View File

@ -788,10 +788,24 @@ class Notice extends Memcached_DataObject
return $notice;
}
$notice->whereAdd('id in (' . implode(', ', $ids) . ')');
$notice->orderBy('id DESC');
$notice->find();
return $notice;
$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);
}
}