/** * {@inheritDoc} */ protected function toEntity(array $photo) { $imageBag = clone $this->imageManager->getImageBag(); $imageBag->setId((int) $photo['id'])->setCover($photo['photo']); $entity = new PhotoEntity(); $entity->setImageBag($imageBag)->setId($photo['id'], PhotoEntity::FILTER_INT)->setName($photo['name'], PhotoEntity::FILTER_HTML)->setAlbumId($photo['album_id'], PhotoEntity::FILTER_INT)->setAlbumName($this->albumMapper->fetchNameById($photo['album_id']), PhotoEntity::FILTER_HTML)->setPhoto($photo['photo'], PhotoEntity::FILTER_HTML)->setDescription($photo['description'], PhotoEntity::FILTER_HTML)->setOrder($photo['order'], PhotoEntity::FILTER_INT)->setPublished($photo['published'], PhotoEntity::FILTER_BOOL)->setDate(date('d/m/y', $photo['date'])); return $entity; }
/** * Gets all breadcrumbs by associated id * * @param string $id Category id * @return array */ private function getBreadcrumbsById($id) { $wm = $this->webPageManager; $builder = new BreadcrumbBuilder($this->albumMapper->fetchBcData(), $id); return $builder->makeAll(function ($breadcrumb) use($wm) { return array('name' => $breadcrumb['name'], 'link' => $wm->getUrl($breadcrumb['web_page_id'], $breadcrumb['lang_id'])); }); }