Init page meta of page

@param Page $page
550428
final protected function initPageMetas(Page $page)
    {
        if (!isset($this->pageMetas))
        {
            $this->pageMetas = array();
            if ($page->getId() > 0)
            {
                $metas = $this->doctrine->getRepository('FulgurioLightCMSBundle:PageMeta')->findByPage($page->getId());
                foreach ($metas as $meta)
                {
                    $this->pageMetas[$meta->getMetaKey()] = $meta;
                }
            }
        }
    }
948376
public function setPage($page)
    {
        if (empty($page)) {
            return $this->clearPage();
        }

        session()->put($this->getSessionKey(static::TYPE_PAGE), $page);

        return $this;
    }
539893
public function addChild(Page $page): Page
    {
        $this->children->add($page);

        if ($page->getParent() !== $this) {
            $page->setParent($this);
        }

        return $this;
    }
1145366
public function page($page)
    {
        $page = (int)$page;

        if($page<0){
            throw new \RuntimeException('Invalid page specified', ResourceException::INVALID_PAGE);
        }

        $this->page = $page;

        return $this;
    }
107745
public function putMetadataAction(Page $page, Request $request)
    {
        $metadatas = $this->application
                ->getContainer()
                ->get('nestednode.metadata.resolver')
                ->resolve($page);

        foreach ($request->request->all() as $name => $attributes) {
            if ($metadatas->has($name)) {
                foreach ($attributes as $attr_name => $attr_value) {
                    if ($attr_value !== $metadatas->get($name)->getAttribute($attr_name)) {
                        $metadatas->get($name)->setAttribute($attr_name, $attr_value, null, false);
                    }
                }
            }
        }

        $page->setMetaData($metadatas);
        $this->getApplication()->getEntityManager()->flush();

        return $this->createJsonResponse(null, 204);
    }
513972
public function init_page(moodle_page $page) {
        $themeinitfunction = 'theme_'.$this->name.'_page_init';
        if (function_exists($themeinitfunction)) {
            $themeinitfunction($page);
        }
    }
1143363
public function setPage(Page $page)
    {
        $this->page = $page;
        $revision = $page->getCurrentRevision();
        if (empty($revision)) {
            $revision = $page->getPublishedRevision();
        }
        $revisionId = null;
        if (!empty($revision)) {
            $revisionId = $revision->getRevisionId();
        }
        $this->setRevisionId($revisionId);
        $this->setTitle($page->getPageTitle());
        $this->setPageId($page->getPageId());
    }
512941
private function setMainNode(AbstractClassContent $content, Page $page)
    {
        if (null !== $content->getMainNode()) {
            return;
        }

        $content->setMainNode($page);

        if (null !== $this->entityManager) {
            $uow = $this->entityManager->getUnitOfWork();
            $meta = $this->entityManager->getClassMetadata(get_class($content));
            if ($uow->isEntityScheduled($content)) {
                $uow->recomputeSingleEntityChangeSet($meta, $content);
            } elseif ($uow->isEntityScheduled($page)) {
                $uow->computeChangeSet($meta, $content);
            }
        }
    }
234420
public void init(PageContext pageContext) {

        ServletContext servCtx = pageContext.getServletContext();
        ServletConfig servConfig = pageContext.getServletConfig();

        init(servCtx, servConfig);
    }
675828
private void setPageParam(int page) {
        pageParam.set(0, Integer.toString(page));
        queryParams.put(PAGE_PARAM, pageParam);
    }
1133915
protected function loadPage($page)
    {
        $this->pageStart = $page * $this->pageSize;
        $this->pageData = $this->query->setFirstResult($this->pageStart)->setMaxResults($this->pageSize)->getResult();
    }
452316
public function initialise_js(moodle_page $page) {
        static $initialised = false;
        if (!$initialised) {
            $page->requires->yui_module('moodle-core-actionmenu', 'M.core.actionmenu.init');
            $initialised = true;
        }
    }
183344
function set_page($page)
    {
        $this->list_page = (int)$page;
        $this->ldap->set_vlv_page($this->list_page, $this->page_size);
    }
1172533
private function parseDefinition(array $definition, MetaData $metadata, Page $page = null)
    {
        foreach ($definition as $attrname => $attrvalue) {
            if (!is_array($attrvalue)) {
                $attrvalue = [$attrvalue];
            }

            if (!$metadata->isComputed($attrname)) {
                continue;
            }
            $scheme = ('' === $metadata->getAttribute($attrname)) ? reset($attrvalue) : $metadata->getAttribute($attrname);

	    if (
                    'title' === $metadata->getName()
                    && null !== $page
                    && null !== $page->getTitle()
                    && array_key_exists('default', $attrvalue)
            ) {
                $scheme = $page->getTitle();		
            } elseif (array_key_exists('default', $attrvalue)) {		
                $scheme = $attrvalue['default'];
            }

            if (
                    null !== $page
                    && null !== $page->getLayout()
                    && array_key_exists('layout', $attrvalue)
                    && array_key_exists($page->getLayout()->getUid(), $attrvalue['layout'])
            ) {
                $scheme = $attrvalue['layout'][$page->getLayout()->getUid()];
            }

            if (
                    null !== $page
                    && null !== $page->getLayout()
                    && array_key_exists('layout', $attrvalue)
                    && array_key_exists($page->getLayout()->getLabel(), $attrvalue['layout'])
            ) {
                $scheme = $attrvalue['layout'][$page->getLayout()->getLabel()];
            }

            $matches = [];
            $isComputed = true;
            if (null !== $page && preg_match(self::MATCH_PATTERN, $scheme)) {
                $value = $this->resolveScheme($scheme, $page);
            } elseif (preg_match(self::CONST_PATTERN, $scheme, $matches)) {
                $value = $this->resolveConst($matches[1], $page);
            } else {
                $value = $scheme;
                $scheme = null;
                $isComputed = false;
            }
            $metadata->setAttribute($attrname, $value, $scheme, $isComputed);
        }
    }
271167
public function setPage(Page $page)
    {
        $this->_page = $page;
        $page->setMainSection($this);

        return $this;
    }
41160
public function deactivatePage(Page $page)
    {

        if (!$this->isActive($page)) {
            return;
        }
        $this->deactivatePageId($page->getID());


    }
1048782
public function setCurrentPage($page)
  {
    $this->currentPage = $page;
    $this->forcedPage = true;
    $this->updateTable();
  }