summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-08 21:02:54 -0500
committerEvan Prodromou <evan@status.net>2009-12-08 21:02:54 -0500
commit45408142e9d7431dd4a664262d4806c655cc5c68 (patch)
treea2ecfe35e0fd69831d63b28c1e0dc6e6bb4308fb
parent21757186e9a7ffd2e3330fd4ef61ffeb2dc0229b (diff)
reorder notices when not using memcached
-rw-r--r--classes/Notice.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index bcd7947bd..c36c5a9c6 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -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);
}
}