Создаёт модель разедла из объекта WebPage

@param WebPage $page

@return Html_SiteSection

@since 4.01
170948
public static function createFromWebPage(WebPage $page)
    {
        $raw = array();
        if ($page instanceof TClientUI)
        {
            $raw = $page->dbItem;
        }
        $section = new self($raw);
        return $section;
    }
941967
public function addPage(Page $page): Category
    {
        $this->children->add($page);

        if ($page->getCategory() !== $this) {
            $page->setCategory($this);
        }

        return $this;
    }
1303734
public function setPage($page)
    {
        $this->page = null === $page ? null : (int)$page;
        $this->updateOffset();
        return $this;
    }
818944
public function deletePage(Page $page)
    {
        if ($page->hasMainSection()) {
            $this->getEntityManager()
                    ->getRepository('BackBee\NestedNode\Section')
                    ->deleteSection($page->getSection());
        }

        if (null !== $page->getContentSet()) {
            $this->getEntityManager()
                    ->createQueryBuilder()
                    ->update('BackBee\NestedNode\\Page', 'p')
                    ->set('p._contentset', ':null')
                    ->where('p._contentset = :uid')
                    ->setParameter('uid', $page->getContentSet()->getUid())
                    ->setParameter('null', null)
                    ->getQuery()
                    ->execute();

            $this->getEntityManager()
                    ->getRepository('BackBee\ClassContent\AbstractClassContent')
                    ->deleteContent($page->getContentSet());
        }

        $this->getEntityManager()
                ->createQueryBuilder()
                ->update('BackBee\ClassContent\AbstractClassContent', 'c')
                ->set('c._mainnode', ':null')
                ->where('c._mainnode = :uid')
                ->setParameter('uid', $page->getUid())
                ->setParameter('null', null)
                ->getQuery()
                ->execute();

        $this->getEntityManager()->remove($page);
    }
192944
public function setPage($page)
    {
        if (!is_scalar($page)) {
            $this->page = self::DEFAULT_PAGE;

            return $this;
        } else {
            $page = (int)$page;
        }

        if ($page < 1) {
            $this->page = 1;
        } else {
            $this->page = $page;
        }

        return $this;
    }
794505
public function listAction($page = 1)
    {
        $paginator = $this->get("knp_paginator");

        if ($paginator instanceof \Knp\Component\Pager\Paginator) ;

        $query = $this->getPaginatorQuery();

        if ($this->getRequest()->get("sort")) {
            $query->orderBy($this->getRequest()->get("sort"), strtolower($this->getRequest()->get("direction")) == "asc" ? "asc" : "desc");
        }

        $pagination = $paginator->paginate(
            $query,
            $page
        );

        $pagination->setTemplate('KnpPaginatorBundle:Pagination:twitter_bootstrap_v3_pagination.html.twig');

        return array(
            'page' => $page,
            'pagination' => $pagination,
            'sort' => $this->getRequest()->get('sort'),
            'direction' => $this->getRequest()->get('direction'),
            'route' => $this->getRouteName(),
            'routeParams' => $this->getRouteParams(),
            'template' => $this->getListTemplate()
        );
    }
715215
public function page(int $page, int $perPage): ArrayCollection
    {
        return $this->slice(($page - 1) * $perPage, $perPage);
    }
1030458
private function get_link_html($page)
    {
        global $post;

        if (! empty($post) && $page->ID == $post->ID) {
            $li_class = $this->args['li_active_class'] . ' ' . $this->args['li_class'];
            $link_class = $this->args['link_active_class'] . ' ' . $this->args['link_class'];
        } else {
            $li_class = $this->args['li_class'];
            $link_class = $this->args['link_class'];
        }

        return \sprintf(
            '<li class="%s">%s<a class="%s" href="%s">%s%s%s</a>%s</li>',
            $li_class,
            $this->args['before_link'],
            $link_class,
            get_the_permalink($page),
            $this->args['before_text'],
            get_the_title($page),
            $this->args['after_text'],
            $this->args['after_link']
        );
    }
1188028
public function get_slots($page = 'all') {
        if ($page === 'all') {
            $numbers = array();
            foreach ($this->pagelayout as $numbersonpage) {
                $numbers = array_merge($numbers, $numbersonpage);
            }
            return $numbers;
        } else {
            return $this->pagelayout[$page];
        }
    }
436936
private function findChildrenPages(Page $page)
    {
        $pages = Page::where('parent_id', $page->id)->orderBy('header_order')->get();

        return $pages;
    }
1260110
public function paginate($perPage, $page = null)
    {
        if (empty($page)) {
            $page = request('page', 1);
        }
        $offset = ($page * $perPage) - $perPage;

        $collection = $this->all();
        $newItems = array_slice($collection, $offset, $perPage, true);
        return $this->createChildCollection($newItems);
    }
809403
public function page($page = null) {
			if ($page != null) {
				$this->_page = $page;
				return true;
			}
			else {
				return $this->_page;
			}
		}
892540
public function getPage($page) {
			if (array_key_exists($page, $this->pageCache))
				return $this->pageCache[$page];

			if (!file_exists(sprintf('%s/pages/%s.php', $this->getPluginRoot(), $page)))
				return '<div><strong>Page not found.</strong></div>';
			else {
				ob_start();

				include sprintf('%s/pages/%s.php', $this->getPluginRoot(), $page);

				$data = ob_get_clean();
			}

			$this->pageCache[$page] = $data;

			return $data;
		}
1245904
public function init(Page $page = null)
    {
        if (!$page) {
            return $this;
        }

        $this->page = $page;
        $this->online = $page->isOnline();
        $this->name = $page->getName();
        $this->meta = $page->getMeta();
        $this->openGraph = $page->getOpenGraph();
        $this->title = $page->getTitle();

        return $this;
    }
1291910
static function FindPageRights(Page $page)
    {
        $currPage = $page;
        $result = null;
        do 
        {
            $result = $currPage->GetUserGroupRights();
            $currPage = $currPage->GetParent();
        } 
        while (!$result && $currPage);
        if (!$result && $page->GetSite())
        {
            $siteRights = $page->GetSite()->GetUserGroupRights();
            if ($siteRights)
            {
                return $siteRights->GetPageRights();
            }
        }
        return $result;
    }
929310
static function PageMembergroups(Page $page)
    {
        if (!$page->Exists())
        {
            return array();
        }
        $sql = Access::SqlBuilder();
        $tblPmg = PageMembergroup::Schema()->Table();
        $tblMg = Membergroup::Schema()->Table();
        $join = $sql->Join($tblPmg);
        $joinCondition = $sql->Equals($tblPmg->Field('MemberGroup'), $tblMg->Field('ID'));
        $where = $sql->Equals($tblPmg->Field('Page'), $sql->Value($page->GetID()));
        $orderBy = $sql->OrderList($sql->OrderAsc($tblMg->Field('Name')));
        
        return Membergroup::Schema()->Fetch(false, $where, $orderBy, null, 0, null, $join, JoinType::Inner(), $joinCondition);
    }
508352
public function addPage($page = null)
    {
        if ($page = parent::addPage($page)) {
            $page->setParent($this);
        }

        return $page;
    }