$sql .= (int)$id . (($i++ < $cnt) ? ',' : ');');
}
} else {
- throw new Ansel_Exception('Ansel_Storage::getImages requires either a gallery_id or an array of images_ids');
+ throw new Ansel_Exception('Ansel_Storage::getImages requires either a gallery_id or an array of image ids');
}
/* Limit the query? */
throw new Ansel_Exception($e);
}
+ if (count($ids) == 0) {
+ return array();
+ }
+
try {
$images = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->getImages(array('ids' => array_keys($ids)));
} catch (Horde_Exception_NotFound $e) {
$images = array();
}
+
$results = array();
foreach ($images as $key => $image) {
$results[] = array('image' => $image, 'rank' => $ids[$key]);
}
-
return $results;
}
-
}