Exemple #1
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $category)
 {
     $entity = new VirtualEntity();
     $entity->setId($category['id'], VirtualEntity::FILTER_INT)->setWebPageId($category['web_page_id'], VirtualEntity::FILTER_INT)->setLangId($category['lang_id'], VirtualEntity::FILTER_INT)->setName($category['name'], VirtualEntity::FILTER_HTML)->setTitle($category['title'], VirtualEntity::FILTER_HTML)->setDescription($category['description'], VirtualEntity::FILTER_SAFE_TAGS)->setSlug($this->webPageManager->fetchSlugByWebPageId($category['web_page_id']), VirtualEntity::FILTER_HTML)->setSeo($category['seo'], VirtualEntity::FILTER_BOOL)->setKeywords($category['keywords'], VirtualEntity::FILTER_HTML)->setUrl($this->webPageManager->surround($entity->getSlug(), $entity->getLangId()))->setMetaDescription($category['meta_description'], VirtualEntity::FILTER_HTML);
     return $entity;
 }
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $announce)
 {
     $entity = new VirtualEntity();
     $entity->setId($announce['id'], VirtualEntity::FILTER_INT)->setCategoryId($announce['category_id'], VirtualEntity::FILTER_INT)->setLangId($announce['lang_id'], VirtualEntity::FILTER_INT)->setWebPageId($announce['web_page_id'], VirtualEntity::FILTER_INT)->setCategoryName($this->categoryMapper->fetchNameById($announce['category_id']), VirtualEntity::FILTER_HTML)->setTitle($announce['title'], VirtualEntity::FILTER_HTML)->setName($announce['name'], VirtualEntity::FILTER_HTML)->setIntro($announce['intro'], VirtualEntity::FILTER_SAFE_TAGS)->setFull($announce['full'], VirtualEntity::FILTER_SAFE_TAGS)->setOrder($announce['order'], VirtualEntity::FILTER_INT)->setIcon($announce['icon'], VirtualEntity::FILTER_HTML)->setPublished($announce['published'], VirtualEntity::FILTER_BOOL)->setSeo($announce['seo'], VirtualEntity::FILTER_BOOL)->setSlug($this->webPageManager->fetchSlugByWebPageId($announce['web_page_id']), VirtualEntity::FILTER_HTML)->setKeywords($announce['keywords'], VirtualEntity::FILTER_HTML)->setMetaDescription($announce['meta_description'], VirtualEntity::FILTER_HTML)->setPermanentUrl('/module/announcement/' . $entity->getId())->setUrl($this->webPageManager->surround($entity->getSlug(), $entity->getLangId()));
     return $entity;
 }
Exemple #3
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $form)
 {
     $entity = new VirtualEntity();
     $entity->setId($form['id'], VirtualEntity::FILTER_INT)->setLangId($form['lang_id'], VirtualEntity::FILTER_INT)->setWebPageId($form['web_page_id'], VirtualEntity::FILTER_INT)->setTitle($form['title'], VirtualEntity::FILTER_HTML)->setName($form['name'], VirtualEntity::FILTER_HTML)->setDescription($form['description'], VirtualEntity::FILTER_SAFE_TAGS)->setSeo($form['seo'], VirtualEntity::FILTER_BOOL)->setSlug(Filter::escape($this->webPageManager->fetchSlugByWebPageId($form['web_page_id'])))->setUrl($this->webPageManager->surround($entity->getSlug(), $entity->getLangId()))->setPermanentUrl('/module/mail-form/' . $entity->getId())->setTemplate($form['template'], VirtualEntity::FILTER_HTML)->setKeywords($form['keywords'], VirtualEntity::FILTER_HTML)->setMetaDescription($form['meta_description'] . VirtualEntity::FILTER_HTML)->setMessage($form['message']);
     return $entity;
 }
Exemple #4
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $category)
 {
     $entity = new VirtualEntity();
     $entity->setId($category['id'])->setLangId($category['lang_id'])->setCount($this->postManager->countAllPublishedByCategoryId($entity->getId()))->setSlug($this->webPageManager->fetchSlugByWebPageId($category['web_page_id']))->setTitle($category['name'] . sprintf(' (%s) ', $entity->getCount()))->setUrl($this->webPageManager->surround($entity->getSlug(), $entity->getLangId()));
     return $entity;
 }