Beispiel #1
0
 public function getAlbumCoverUrl(OW_Event $event)
 {
     $params = $event->getParams();
     $albumId = $params['albumId'];
     $coverDao = PHOTO_BOL_PhotoAlbumCoverDao::getInstance();
     if (($coverDto = $coverDao->findByAlbumId($albumId)) === null) {
         if (($photo = $this->albumService->getLastPhotoByAlbumId($albumId)) === null) {
             $coverUrl = $coverDao->getAlbumCoverDefaultUrl();
         } else {
             $coverUrl = $this->photoService->getPhotoUrlByType($photo->id, PHOTO_BOL_PhotoService::TYPE_MAIN, $photo->hash, !empty($photo->dimension) ? $photo->dimension : false);
         }
         $coverUrlOrig = $coverUrl;
     } else {
         $coverUrl = $coverDao->getAlbumCoverUrlForCoverEntity($coverDto);
         $coverUrlOrig = $coverDao->getAlbumCoverOrigUrlForCoverEntity($coverDto);
     }
     $event->setData(array('coverUrl' => $coverUrl, 'coverUrlOrig' => $coverUrlOrig));
     return $event->getData();
 }