本文整理汇总了PHP中PHOTO_BOL_PhotoService::findAlbumPhotoList方法的典型用法代码示例。如果您正苦于以下问题:PHP PHOTO_BOL_PhotoService::findAlbumPhotoList方法的具体用法?PHP PHOTO_BOL_PhotoService::findAlbumPhotoList怎么用?PHP PHOTO_BOL_PhotoService::findAlbumPhotoList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHOTO_BOL_PhotoService
的用法示例。
在下文中一共展示了PHOTO_BOL_PhotoService::findAlbumPhotoList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: albumPhotosFind
/**
* @param OW_Event $e
* @return array
*/
public function albumPhotosFind(OW_Event $e)
{
$params = $e->getParams();
$data = $e->getData();
$album = $this->findRequestedAlbum($params);
if (empty($album)) {
return false;
}
$offset = !empty($params['offset']) ? (int) $params['offset'] : 0;
$limit = !empty($params['limit']) ? (int) $params['limit'] : OW::getConfig()->getValue('photo', 'photos_per_page');
$listType = !empty($params['listType']) ? $params['listType'] : 'latest';
$photos = $this->photoService->findAlbumPhotoList($album->id, $listType, $offset, $limit);
if ($photos) {
foreach ($photos as $key => $photo) {
$id = $photo['id'];
$photos[$key]['userId'] = $album->userId;
$photos[$key]['url'] = OW::getRouter()->urlForRoute('view_photo', array('id' => $id));
$photos[$key]['photoUrl'] = $this->photoService->getPhotoUrl($id);
$photos[$key]['previewUrl'] = $this->photoService->getPhotoUrl($id, true);
}
}
$e->setData($photos);
return $photos;
}
示例2: albumPhotosFind
/**
* @param OW_Event $e
* @return array
*/
public function albumPhotosFind(OW_Event $e)
{
$params = $e->getParams();
$album = $this->findRequestedAlbum($params);
if (empty($album)) {
return false;
}
$offset = !empty($params['offset']) ? (int) $params['offset'] : 0;
$limit = !empty($params['limit']) ? (int) $params['limit'] : OW::getConfig()->getValue('photo', 'photos_per_page');
$listType = isset($params['listType']) ? $params['listType'] : 'latest';
$privacy = isset($params['privacy']) || $params['privacy'] === null ? $params['privacy'] : 'everybody';
$photos = $this->photoService->findAlbumPhotoList($album->id, $listType, $offset, $limit, $privacy);
$list = $this->preparePhotos($photos);
$e->setData($list);
return $list;
}