Ejemplo n.º 1
0
 public function updatePhotosPrivacy($userId, $privacy)
 {
     $albumIdList = $this->photoAlbumDao->getUserAlbumIdList($userId);
     if (!$albumIdList) {
         return;
     }
     $this->photoDao->updatePrivacyByAlbumIdList($albumIdList, $privacy);
     PHOTO_BOL_PhotoService::getInstance()->cleanListCache();
     foreach ($albumIdList as $albumId) {
         if (!($photos = $this->photoDao->getAlbumAllPhotos($albumId))) {
             continue;
         }
         $idList = array();
         foreach ($photos as $photo) {
             array_push($idList, $photo->id);
         }
         $status = $privacy == 'everybody';
         $event = new OW_Event('base.update_entity_items_status', array('entityType' => 'photo_rates', 'entityIds' => $idList, 'status' => $status));
         OW::getEventManager()->trigger($event);
     }
 }