public function execute() { $album_id = waRequest::post('album_id', null, waRequest::TYPE_INT); if ($album_id) { $album_photos_model = new photosAlbumPhotosModel(); $this->response['photo_id'] = array_keys($album_photos_model->getByField('album_id', $album_id, 'photo_id')); } else { $photo_model = new photosPhotoModel(); $photo_id = waRequest::post('photo_id', null, waRequest::TYPE_ARRAY_INT); $this->response['photo_id'] = array_keys($photo_model->getPhotos($photo_id)); } }
/** * Photo ids resolution: get photo ids taking into account photos in stacks (with saving sorting + childrend photos after parent) * @param int|array $photo_id */ private function _resolvePhotoIds($photo_id) { $photo_model = new photosPhotoModel(); return array_keys($photo_model->getPhotos((array) $photo_id)); }