コード例 #1
0
ファイル: search_service.php プロジェクト: tammyrocks/photo
 private function __construct()
 {
     $this->photoDao = PHOTO_BOL_PhotoDao::getInstance();
     $this->photoCacheDao = PHOTO_BOL_PhotoCacheDao::getInstance();
     $this->dataDao = PHOTO_BOL_SearchDataDao::getInstance();
     $this->indexDao = PHOTO_BOL_SearchIndexDao::getInstance();
     $this->entityTypeDao = PHOTO_BOL_SearchEntityTypeDao::getInstance();
     $this->reloadEntityTypes();
 }
コード例 #2
0
ファイル: cron.php プロジェクト: tammyrocks/photo
 public function cleareCache()
 {
     PHOTO_BOL_PhotoCacheDao::getInstance()->cleareCache();
 }
コード例 #3
0
ファイル: photo_service.php プロジェクト: hardikamutech/loov
 public function findPhotoListByDesc($searchVal, $id, $page, $limit)
 {
     if (empty($searchVal)) {
         return array();
     }
     $first = ($page - 1) * $limit;
     $photoCache = PHOTO_BOL_PhotoCacheDao::getInstance();
     if (($cach = $photoCache->findCacheByKey($photoCache->getKey($searchVal))) !== NULL) {
         $data = json_decode($cach->data, TRUE);
         $photos = $this->photoDao->findPhotoListByIdList(explode(',', $data['list'][$id]['ids']), $first, $limit);
     } else {
         $photos = $this->photoDao->findPhotoListByDescription($searchVal, $id, $first, $limit);
     }
     if ($photos) {
         foreach ($photos as $key => $photo) {
             $photos[$key]['url'] = $this->getPhotoUrlByType($photo['id'], self::TYPE_PREVIEW, $photo['hash'], !empty($photo['dimension']) ? $photo['dimension'] : FALSE);
         }
     }
     return $photos;
 }