public function getAlbumCoverForList(array $albumList) { if (!$albumList) { return array(); } $albumIdList = array(); foreach ($albumList as $album) { $albumIdList[] = $album['id']; } $covers = PHOTO_BOL_PhotoAlbumCoverDao::getInstance()->getAlbumCoverUrlListForAlbumIdList($albumIdList); foreach ($this->photoDao->getLastPhotoForList(array_diff($albumIdList, array_keys($covers))) as $photo) { $covers[$photo->albumId] = $this->photoDao->getPhotoUrl($photo->id, $photo->hash, PHOTO_BOL_PhotoService::TYPE_PREVIEW, !empty($photo->dimension) ? $photo->dimension : FALSE); } foreach (array_diff($albumIdList, array_keys($covers)) as $id) { $covers[$id] = PHOTO_BOL_PhotoAlbumCoverDao::getInstance()->getAlbumCoverDefaultUrl(); } return $covers; }