/** * @param array $values * @param Page $page * @throws PagePublicationTimeException * @throws PageIntroHtmlLengthException */ private function fillPageEntity(array $values, Page $page) { $page->setTitle($values['title']); $page->setMetaDescription($values['description']); $page->setMetaKeywords($values['keywords']); $page->setIntro($values['intro']); $page->setIntroHtml($this->texy->process($values['intro'])); $page->setText($values['text']); if ($values['text'] === null) { $page->setTextHtml(null); } else { $page->setTextHtml($this->texy->process($values['text'])); } $page->setPublishedAt($values['publishedAt']); $page->setAllowedComments($values['allowedComments']); if ($page->isDraft() and $values['saveAsDraft'] === false) { $page->setAsPublished($values['publishedAt']); } }