/**
  * {@inheritDoc}
  */
 protected function toEntity(array $record)
 {
     $entity = new VirtualEntity();
     $entity->setId($record['id'], VirtualEntity::FILTER_INT)->setName($record['name'], VirtualEntity::FILTER_HTML)->setEmail($record['email'], VirtualEntity::FILTER_HTML)->setActive($record['active'], VirtualEntity::FILTER_BOOL);
     return $entity;
 }
Beispiel #2
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $block)
 {
     $entity = new VirtualEntity();
     $entity->setId($block['id'], VirtualEntity::FILTER_INT)->setName($block['name'], VirtualEntity::FILTER_HTML)->setClass($block['class'], VirtualEntity::FILTER_HTML)->setContent($block['content'], VirtualEntity::FILTER_SAFE_TAGS);
     return $entity;
 }
Beispiel #3
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $advice)
 {
     $entity = new VirtualEntity();
     $entity->setId($advice['id'], VirtualEntity::FILTER_INT)->setLangId($advice['lang_id'], VirtualEntity::FILTER_INT)->setTitle($advice['title'], VirtualEntity::FILTER_HTML)->setContent($advice['content'], VirtualEntity::FILTER_SAFE_TAGS)->setPublished($advice['published'], VirtualEntity::FILTER_BOOL);
     return $entity;
 }
Beispiel #4
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $order)
 {
     $entity = new VirtualEntity();
     $entity->setId($order['id'], VirtualEntity::FILTER_INT)->setDate($order['date'], VirtualEntity::FILTER_TAGS)->setName($order['name'], VirtualEntity::FILTER_HTML)->setEmail($order['email'], VirtualEntity::FILTER_HTML)->setPhone($order['phone'], VirtualEntity::FILTER_HTML)->setAddress($order['address'], VirtualEntity::FILTER_HTML)->setComment($order['comment'], VirtualEntity::FILTER_HTML)->setDelivery($order['delivery'], VirtualEntity::FILTER_HTML)->setQty($order['qty'], VirtualEntity::FILTER_INT)->setTotalPrice($order['total_price'], VirtualEntity::FILTER_FLOAT)->setApproved($order['approved'], VirtualEntity::FILTER_BOOL);
     return $entity;
 }
Beispiel #5
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $qa)
 {
     $entity = new VirtualEntity();
     $entity->setId($qa['id'], VirtualEntity::FILTER_INT)->setLangId($qa['lang_id'], VirtualEntity::FILTER_INT)->setQuestion($qa['question'], VirtualEntity::FILTER_HTML)->setAnswer($qa['answer'], VirtualEntity::FILTER_SAFE_TAGS)->setQuestioner($qa['questioner'], VirtualEntity::FILTER_HTML)->setAnswerer($qa['answerer'], VirtualEntity::FILTER_HTML)->setPublished($qa['published'], VirtualEntity::FILTER_BOOL)->setTimestampAsked($qa['timestamp_asked'], VirtualEntity::FILTER_INT)->setTimestampAnswered($qa['timestamp_answered'], VirtualEntity::FILTER_INT)->setDateAsked(strtotime($qa['timestamp_asked']))->setDateAnswered(strtotime($qa['timestamp_answered']))->setIP($qa['ip'], VirtualEntity::FILTER_HTML);
     return $entity;
 }
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $category)
 {
     $entity = new VirtualEntity();
     $entity->setId($category['id'], VirtualEntity::FILTER_INT)->setName($category['name'], VirtualEntity::FILTER_HTML)->setClass($category['class'], VirtualEntity::FILTER_HTML);
     return $entity;
 }
Beispiel #7
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;
 }
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $row)
 {
     $entity = new VirtualEntity();
     $entity->setId($row['id'], VirtualEntity::FILTER_INT)->setAuthor($row['author'], VirtualEntity::FILTER_TAGS)->setContent($row['content'], VirtualEntity::FILTER_TAGS)->setPublished($row['published'], VirtualEntity::FILTER_BOOL)->setOrder($row['order'], VirtualEntity::FILTER_INT);
     return $entity;
 }
Beispiel #9
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $stoke)
 {
     $entity = new VirtualEntity();
     $entity->setId($stoke['id'], VirtualEntity::FILTER_INT)->setLangId($stoke['lang_id'], VirtualEntity::FILTER_INT)->setTimestampStart($stoke['timestamp_start'], VirtualEntity::FILTER_INT)->setTimestampEnd($stoke['timestamp_end'], VirtualEntity::FILTER_INT)->setName($stoke['name'], VirtualEntity::FILTER_TAGS)->setTitle($stoke['title'], VirtualEntity::FILTER_TAGS)->setPublished($stoke['published'], VirtualEntity::FILTER_BOOL)->setIntroduction($stoke['introduction'], VirtualEntity::FILTER_SAFE_TAGS)->setDescription($stoke['description'], VirtualEntity::FILTER_SAFE_TAGS)->setKeywords($stoke['keywords'], VirtualEntity::FILTER_TAGS)->setMetaDescription($stoke['meta_description'], VirtualEntity::FILTER_TAGS)->setCover($stoke['cover'], VirtualEntity::FILTER_TAGS);
     return $entity;
 }
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $category)
 {
     $entity = new VirtualEntity();
     $entity->setId($category['id'], VirtualEntity::FILTER_INT)->setParentId($category['parent_id'], VirtualEntity::FILTER_INT)->setTitle($category['title'], VirtualEntity::FILTER_TAGS)->setDescription($category['description'], VirtualEntity::FILTER_SAFE_TAGS)->setSeo($category['seo'], VirtualEntity::FILTER_BOOL)->setKeywords($category['keywords'], VirtualEntity::FILTER_TAGS)->setMetaDescription($category['meta_description'], VirtualEntity::FILTER_TAGS);
     return $entity;
 }
Beispiel #11
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $category)
 {
     $entity = new VirtualEntity();
     $entity->setId($category['id'], VirtualEntity::FILTER_INT)->setName($category['name'], VirtualEntity::FILTER_HTML)->setClass($category['class'], VirtualEntity::FILTER_HTML)->setActive($category['active'], VirtualEntity::FILTER_BOOL)->setOptionsCount($this->answerMapper->countByCategoryId($category['id']), VirtualEntity::FILTER_INT);
     return $entity;
 }
Beispiel #12
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $item)
 {
     $entity = new VirtualEntity();
     $entity->setId($item['id'], VirtualEntity::FILTER_INT)->setParentId($item['parent_id'], VirtualEntity::FILTER_INT)->setCategoryId($item['category_id'], VirtualEntity::FILTER_INT)->setWebPageId($item['web_page_id'], VirtualEntity::FILTER_INT)->setName($item['name'], VirtualEntity::FILTER_HTML)->setLink($item['link'], VirtualEntity::FILTER_HTML)->setHasLink($item['has_link'], VirtualEntity::FILTER_BOOL)->setHint($item['hint'], VirtualEntity::FILTER_HTML)->setOpenInNewWindow($item['open_in_new_window'], VirtualEntity::FILTER_BOOL)->setPublished($item['published'], VirtualEntity::FILTER_BOOL);
     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;
 }
Beispiel #14
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $review)
 {
     $entity = new VirtualEntity();
     $entity->setId($review['id'], VirtualEntity::FILTER_INT)->setTimestamp($review['timestamp'], VirtualEntity::FILTER_INT)->setIp($review['ip'], VirtualEntity::FILTER_HTML)->setPublished($review['published'], VirtualEntity::FILTER_BOOL)->setName($review['name'], VirtualEntity::FILTER_HTML)->setEmail($review['email'], VirtualEntity::FILTER_HTML)->setReview($review['review'], VirtualEntity::FILTER_SAFE_TAGS);
     return $entity;
 }
Beispiel #15
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $banner)
 {
     $entity = new VirtualEntity();
     $entity->setId($banner['id'], VirtualEntity::FILTER_INT)->setName($banner['name'], VirtualEntity::FILTER_HTML)->setLink($banner['link'], VirtualEntity::FILTER_HTML)->setFile($banner['file'], VirtualEntity::FILTER_HTML)->setUrlPath($this->urlPathGenerator->getPath($entity->getId(), $entity->getFile()));
     return $entity;
 }
Beispiel #16
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $answer)
 {
     $entity = new VirtualEntity(false);
     $entity->setId($answer['id'], VirtualEntity::FILTER_INT)->setPublished($answer['published'], VirtualEntity::FILTER_BOOL)->setTitle($answer['title'], VirtualEntity::FILTER_HTML)->setCategoryId($answer['category_id'], VirtualEntity::FILTER_INT)->setOrder($answer['order'], VirtualEntity::FILTER_INT)->setVotes($answer['votes'], VirtualEntity::FILTER_INT);
     return $entity;
 }
Beispiel #17
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;
 }
Beispiel #18
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;
 }
Beispiel #19
0
 /**
  * {@inheritDoc}
  */
 protected function toEntity(array $faq)
 {
     $entity = new VirtualEntity();
     $entity->setId($faq['id'], VirtualEntity::FILTER_INT)->setQuestion($faq['question'], VirtualEntity::FILTER_HTML)->setAnswer($faq['answer'], VirtualEntity::FILTER_SAFE_TAGS)->setOrder($faq['order'], VirtualEntity::FILTER_INT)->setPublished($faq['published'], VirtualEntity::FILTER_BOOL);
     return $entity;
 }
Beispiel #20
0
 /**
  * {@inheritDoc} 
  */
 protected function toEntity(array $contact)
 {
     $entity = new VirtualEntity();
     $entity->setId($contact['id'], VirtualEntity::FILTER_INT)->setName($contact['name'], VirtualEntity::FILTER_HTML)->setPhone($contact['phone'], VirtualEntity::FILTER_HTML)->setEmail($contact['email'], VirtualEntity::FILTER_HTML)->setDescription($contact['description'], VirtualEntity::FILTER_HTML)->setOrder($contact['order'], VirtualEntity::FILTER_INT)->setDefault($this->defaultMapper->isDefault($entity->getId()), VirtualEntity::FILTER_BOOL)->setPublished($contact['published'], VirtualEntity::FILTER_BOOL);
     return $entity;
 }