/** * @return self * @throws \Yandex\Fotki\Exception\Api\PhotosCollection */ public function load() { try { $this->_loadCollectionData($this->_apiUrl); foreach ($this->_entries as $entry) { $photo = new \Yandex\Fotki\Api\Photo($this->_transport, $entry['links']['self']); $photo->initWithData($entry); $this->_data[$photo->getId()] = $photo; } } catch (\Yandex\Fotki\Exception\Api $ex) { throw new \Yandex\Fotki\Exception\Api\PhotosCollection($ex->getMessage(), $ex->getCode(), $ex); } return $this; }
/** * Загружаем список фотографий * @throws \Yandex\Fotki\Exception\Api\PhotosCollection * @return self */ protected function _loadPhotos() { if (!empty($this->_apiUrlPhotos)) { try { $this->_loadCollectionData($this->_apiUrlPhotos); foreach ($this->_entries as $entry) { $photo = new \Yandex\Fotki\Api\Photo($this->_transport); $photo->initWithData($entry)->setApiUrlAlbum($this->_apiUrl); $this->_data[$photo->getId()] = $photo; } } catch (\Yandex\Fotki\Exception\Api $ex) { throw new \Yandex\Fotki\Exception\Api\PhotosCollection($ex->getMessage(), $ex->getCode(), $ex); } } return $this; }