Ejemplo n.º 1
0
 /**
  * @param Page $page
  */
 private function removePageUrl(Page $page)
 {
     /** @var Url $url */
     $url = $this->urlFacade->getByPath($page->getUrlPath());
     if ($url !== null) {
         $this->cache->clean([Cache::TAGS => $url->getCacheKey()]);
         $this->em->remove($url);
     }
 }
Ejemplo n.º 2
0
 private function fillFormBy(Page $page)
 {
     $this['pageForm']['url']->setDefaultValue($page->getUrlPath());
     $this['pageForm']['publishedAt']->setDefaultValue($page->getTitle());
     if ($page->getPublishedAt() !== null) {
         $this['pageForm']['publishedAt']->setDefaultValue($page->getPublishedAt()->format('j.n.Y H:i'));
     }
     $this['pageForm']['title']->setDefaultValue($page->getTitle());
     $this['pageForm']['intro']->setDefaultValue($page->getIntro());
     $this['pageForm']['text']->setDefaultValue($page->getText());
     $this['pageForm']['allowedComments']->setDefaultValue($page->getAllowedComments());
     $this['pageForm']['description']->setDefaultValue($page->getMetaDescription());
     $this['pageForm']['keywords']->setDefaultValue($page->getMetaKeywords());
     $this['pageForm']['lang']->setDefaultValue($page->getLocaleName());
 }