Esempio n. 1
0
 /**
  * {@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;
 }
Esempio n. 2
0
 /**
  * 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']));
     });
 }