@param HasPageTemplateInterface $page The page

@return PageTemplateConfiguration
356165
public function findOrCreateFor(HasPageTemplateInterface $page)
    {
        $pageTemplateConfiguration = $this->repo->findFor($page);

        if (null === $pageTemplateConfiguration) {
            $pageTemplates = $this->reader->getPageTemplates($page);
            $names = array_keys($pageTemplates);
            $defaultPageTemplate = $pageTemplates[$names[0]];

            $pageTemplateConfiguration = new PageTemplateConfiguration();
            $pageTemplateConfiguration->setPageId($page->getId());
            $pageTemplateConfiguration->setPageEntityName(ClassLookup::getClass($page));
            $pageTemplateConfiguration->setPageTemplate($defaultPageTemplate->getName());
        }

        return $pageTemplateConfiguration;
    }
151091
public function setPage($page)
  {
    if ($this->isLocked()) {
      return $this->getObj()->setPage($page)->setLocked();
    } else {
      return parent::setPage($page);
    }
  }
1017894
public function save(PageInterface $page)
    {
        if (!$page->getId() && !$page->getContentRoute()->getTemplateName()) {
            $page->setContentRoute(new ContentRoute());
        }
        $this->_em->persist($page);
    }
1259002
public function render($template, PageInterface $page = null)
    {
        if (!$template) {
            return null;
        }

        $twigTemplate = $this->twig->createTemplate($template);

        return $twigTemplate->render([
            'node' => $page,
        ]);
    }
390506
private function getPageMediaSet(HasMediaSetInterface $page)
    {
        if (false === $this->preloadedMediaSets) {
            $data = $this->repository
                ->createQueryBuilder('pm')
                ->join(Media::class, 'media', Join::WITH, 'pm.media = media.id')
                ->select(['pm.pageType', 'pm.pageId', 'pm.type', 'media.url'])
                ->getQuery()
                ->getResult();

            $this->preloadedMediaSets = true;

            foreach ($data as $media) {
                $this->mediaSets[$media['pageType']][$media['pageId']][$media['type']] = $media['url'];
            }
        }

        if (false === isset($this->mediaSets[$page->getType()][$page->getId()])) {
            return [];
        }

        return $this->mediaSets[$page->getType()][$page->getId()];
    }
9288
public function addPage($page)
    {
        if (is_array($page)) {
            $page = static::makePage($page);
        } elseif (is_string($page) or is_null($page)) {
            $title = $page;

            $page = app(PageInterface::class);
            $page->setTitle($title);
        }

        if (! ($page instanceof PageInterface)) {
            return;
        }

        $this->getPages()->push($page);

        return $page;
    }
439866
public function makePageCopy(PageInterface $page)
    {
        $pageClass = $this->pageManager->getClassName();
        /** @var PageInterface $pageCopy */
        $pageCopy = new $pageClass();

        $now = new \DateTime();

        $postfix = sprintf(' copy %s', $now->format('d.m.Y H:i:s'));

        $pageCopy->setPageName($page->getPageName().$postfix);
        $pageCopy->setMetaTitle($page->getMetaTitle());
        $pageCopy->setUrl($page->getUrl().$postfix);
        $pageCopy->setMetaKeyword($page->getMetaKeyword());
        $pageCopy->setMetaDescription($page->getMetaDescription());
        $pageCopy->setActiveFrom($page->getActiveFrom());
        $pageCopy->setIsHome(false);
        $pageCopy->setTemplateName($page->getTemplateName());
        $pageCopy->setLocale($page->getLocale());

        $layoutBlocks = $page->getLayoutBlock();

        $om = $this->registry->getManager();

        foreach ($layoutBlocks as $layoutBlock) {

            /** @var $newLayoutBlock \Networking\InitCmsBundle\Model\LayoutBlockInterface */
            $newLayoutBlock = clone $layoutBlock;


            $content = $om->getRepository($newLayoutBlock->getClassType())->find(
                $newLayoutBlock->getObjectId()
            );
            $newContent = clone $content;

            $om->persist($newContent);
            $om->flush();

            $newLayoutBlock->setObjectId($newContent->getId());
            $newLayoutBlock->setPage($pageCopy);

            $om->persist($newLayoutBlock);
        }

        $om->persist($pageCopy);

        $om->flush();

        return $pageCopy;
    }
387243
public function getNodeTranslationFor(HasNodeInterface $page)
    {
        $version = $this->getNodeVersionFor($page);

        return $version ? $version->getNodeTranslation() : null;
    }
556596
public function page($page = null)
    {
        if (isset($page)) {
            $this->setPage($page);

            return $this;
        }

        return $this->getPage();
    }
803886
public function setPage(\Core\Entity\MenuPage $page = null) {
        $this->page = $page;

        return $this;
    }
1287351
public function page($page)
    {
        //set the page
        $this->layout->page = $page;

        //set the layout content and title
        $this->layout->content = view($page);

        return $this->layout;
    }
507058
public static function description(PageInterface $page = null)
    {
        $page = $page ?: Router::getActivePage();
        $description = $page->getDescription() ?:
            ChunkFacade::get('text', 'standfirst', $page)->text();

        return strip_tags($description);
    }
909229
public function page($page = null) {
        if ($page === null) {
            return $this->page;
        }

        $this->page = (int) $page;

        return $this;
    }
35293
public function getTemplateForPage(ContentPage $contentPage)
    {
        if (null !== $contentPage->getTemplateId())
        {
            return $contentPage->getTemplate()->getTemplateName();
        }

        return $this->defaultTemplate;
    }
727859
public function setPage(\VFou\CmsBundle\Entity\Page $page = null)
    {
        $this->page = $page;

        return $this;
    }
979862
public function render(PageInterface $page)
    {
        foreach ($this->renderers as $renderer) {
            if (!$renderer->supports($page)) {
                continue;
            }

            return $renderer->render($page);
        }

        return $page->getContent();
    }
408428
public function setPage($page)
    {
        $this->stateChanged = true;
        $path = $this->prefixWithNamespace('page');
        $this->argumentsAccessor->set($path, $page);
        return $this;
    }