Ejemplo n.º 1
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return ADVANCEDPHOTO_BOL_PhotoAlbumDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Ejemplo n.º 2
0
 /**
  * Returns user's photo albums list
  *
  * @param string $listType
  * @param int $page
  * @param int $limit
  * @return array of PHOTO_BOL_PhotoAlbum
  */
 public function findAlbumList($listType, $page, $limit, $search = '')
 {
     $albums = $this->advancedphotoAlbumDao->getAlbumList($listType, $page, $limit, $search);
     $list = array();
     if ($albums) {
         $albumIdList = array();
         foreach ($albums as $key => $album) {
             array_push($albumIdList, $album['id']);
             $list[$key]['dto'] = $album;
         }
         $covers = $this->albumService->getAlbumCoverForList($albumIdList);
         $counters = $this->albumService->countAlbumPhotosForList($albumIdList);
         foreach ($albums as $key => $album) {
             $list[$key]['cover'] = $covers[$album['id']];
             $list[$key]['photo_count'] = $counters[$album['id']];
         }
     }
     return $list;
 }