Gets all the pages from a mounted page tree.

@param array $mountPage
@return array An array of page IDs in the mounted page tree
165506
protected function resolveMountPageTree($mountPage)
    {
        $mountPageSourceId = $mountPage['mountPageSource'];
        $mountPageIdentifier = $this->getMountPointIdentifier($mountPage);

        $siteRepository = GeneralUtility::makeInstance(SiteRepository::class);
        /* @var $siteRepository SiteRepository */
        $mountedSite = $siteRepository->getSiteByPageId($mountPageSourceId, $mountPageIdentifier);

        return $mountedSite->getPages($mountPageSourceId);
    }
1224182
public static function getBySectionOfSite($page)
    {
        $identifier = sprintf('/multilingual/section/%s', $page->getCollectionID());
        $cache = \Core::make('cache/request');
        $item = $cache->getItem($identifier);
        if (!$item->isMiss()) {
            $returnID = $item->get();
        } else {

            $item->lock();

            $returnID = false;

            if ($page->isPageDraft()) {
                $tree = false;
                if ($page->getPageDraftTargetParentPageID()) {
                    $cParentID = $page->getPageDraftTargetParentPageID();
                    if ($cParentID) {
                        $parent = Page::getByID($cParentID);
                        $tree = $parent->getSiteTreeObject();
                    }
                }
            }

            if (!isset($tree)) {
                $tree = $page->getSiteTreeObject();
            }

            if ($tree instanceof SiteTree) {
                $returnID = $tree->getSiteHomePageID();
            }

            $cache->save($item->set($returnID));
        }

        if ($returnID) {
            return static::getByID($returnID);
        }
    }
875996
public function getPlans($page = '')
    {
        $planObjects = [];
        $plans = $this->getPlanResource()->getAll($page);

        if ($plans instanceof \Exception) {
            throw $plans;
        }

        foreach ($plans as $plan) {
            $planObject = new Plan($this->getPlanResource());
            $planObjects[] = $planObject->_setAttributes($plan);
        }

        return $planObjects;
    }
142092
protected function getPages(): array
    {
        $pages = [];

        $pages['previous_page'] = $this->pagerfanta->hasPreviousPage() ?
            $this->generateUrl($this->pagerfanta->getPreviousPage()) :
            false;

        $pages['first_page'] = $this->startPage > 1 ? $this->generateUrl(1) : false;
        $pages['mobile_first_page'] = $this->pagerfanta->getCurrentPage() > 2 ? $this->generateUrl(1) : false;

        $pages['second_page'] = $this->startPage === 3 ? $this->generateUrl(2) : false;

        $pages['separator_before'] = $this->startPage > 3;

        $middlePages = [];
        for ($i = $this->startPage, $end = $this->endPage; $i <= $end; ++$i) {
            $middlePages[$i] = $this->generateUrl($i);
        }

        $pages['middle_pages'] = $middlePages;

        $pages['separator_after'] = $this->endPage < $this->pagerfanta->getNbPages() - 2;

        $pages['second_to_last_page'] = $this->endPage === $this->pagerfanta->getNbPages() - 2 ?
            $this->generateUrl($this->pagerfanta->getNbPages() - 1) :
            false;

        $pages['last_page'] = $this->pagerfanta->getNbPages() > $this->endPage ?
            $this->generateUrl($this->pagerfanta->getNbPages()) :
            false;

        $pages['mobile_last_page'] = $this->pagerfanta->getCurrentPage() < $this->pagerfanta->getNbPages() - 1 ?
            $this->generateUrl($this->pagerfanta->getNbPages()) :
            false;

        $pages['next_page'] = $this->pagerfanta->hasNextPage() ?
            $this->generateUrl($this->pagerfanta->getNextPage()) :
            false;

        return $pages;
    }
946049
public function findAll($page = 1, $max = 50)
    {
        $offset = (($page - 1) * $max);
        $products = $this->getEm()->getRepository("AmulenShopBundle:Product")->findBy(array(), array(), $max, $offset);
        return $products;
    }
933704
public function getPageParts(HasPagePartsInterface $page, $context = 'main')
    {
        /** @var $entityRepository PagePartRefRepository */
        $entityRepository = $this->em->getRepository('KunstmaanPagePartBundle:PagePartRef');
        $pageparts = $entityRepository->getPageParts($page, $context);

        return $pageparts;
    }
1057653
private function getPagesDatas($rootPages)
	{
		$idPage = $this->params()->fromQuery('nodeId', -1);

		if ($idPage == MelisCmsRightsService::MELISCMS_PREFIX_PAGES . '_root')
			$idPage = -1;
		else
			$idPage = str_replace(MelisCmsRightsService::MELISCMS_PREFIX_PAGES . '_', '', $idPage);

		$pageMelisKey = 'meliscms_page';
		$melisAppConfig =$this->getServiceLocator()->get('MelisCoreConfig');
		$appsConfig = $melisAppConfig->getItem($pageMelisKey);

		if (!empty($appsConfig['conf']['id']))
			$zoneId = $appsConfig['conf']['id'];
		else
			$zoneId = 'id_meliscms_page';


		// Get the children
		$melisTree = $this->serviceLocator->get('MelisEngineTree');
		if (!empty($rootPages))
		{
			if ($rootPages[0] == -1 || $idPage != -1)
			{
				$children = $melisTree->getPageChildren($idPage);
				$children = $children->toArray();
			}
			else
			{
				$children = array();
				$tablePageTree = $this->getServiceLocator()->get('MelisEngineTablePageTree');
				foreach ($rootPages as $idPage)
				{
					$pageDetails = $tablePageTree->getFullDatasPage($idPage, '');
					$pageDetails = $pageDetails->toArray();
					$children = array_merge($children, $pageDetails);
				}
			}
		}
		else
		{
			return array();
		}


		// Making a new array with one unique page from published or save
		$final = array();
		foreach($children as $page)
		{
			$data_page_id = $page['tree_page_id'];

			/**
			 * Check which table must be used depending on if there's data
			 * in saved or published table.
			 * Saved results come withe same column name prefixed by s_
			 */
			if (!empty($page['s_page_id']))
			{
				$has_saved_version = 1;
				$prefixTable = 's_';
			}
			else
			{
				$has_saved_version = 0;
				$prefixTable = '';
			}

			// Prefix the id with the pageId
			$zoneIdTmp = $data_page_id . '_' . $zoneId;

			// Check if node has children
			$has_children = false;
			$childrenTmp = $melisTree->getPageChildren($data_page_id);
			if ($childrenTmp)
			{
				$childrenTmp = $childrenTmp->toArray();
				if (count($childrenTmp) > 0)
					$has_children = true;
			}

			// Check if the publish page is online to know for our result
			$is_online = 0;
			if (!empty($page['page_status']) && $page['page_status'] == 1)
				$is_online = 1;

			// Type of page is in table defined previously
			$data_page_type = $page[$prefixTable . 'page_type'];

			// We show always published name in tree, saved if no published
			if (!empty($page['page_name']))
				$data_page_name = $page['page_name'];
			else
			{
				if (!empty($page['s_page_name']))
					$data_page_name = $page['s_page_name'];
				else
					$data_page_name = $page['page_name'];
			}

			switch ($data_page_type) {
				case 'PAGE': 
					$data_icon = 'fa fa-file-o';
					break;
				case 'SITE': 
					$data_icon = 'fa fa-home';
					break;
				case 'FOLDER': 
					$data_icon = 'fa fa-folder-open-o';
					break;
				case 'NEWSLETTER': 
					$data_icon = 'fa fa-newspaper-o';
					break;
				default: 
					$data_icon = '';
					break;
			}

			$newpage = array(
				// These datas are common to all treeviews
				'item_zoneid' => $zoneIdTmp,
				'item_melisKey' => $pageMelisKey,
				'item_name' => $data_page_id . ' - ' . $data_page_name,
				'item_is_on' => $is_online,
				'item_has_version' => $has_saved_version,
				'item_icon' => $data_icon,
				'item_has_children' => $has_children,
				'item_dragdrop' => $this->isAllowedDragDrop(),

				// These datas are added and will be sent back when calling the view from the melisKey
				'item_datas' => array(
					'page_title' => $data_page_name,
					'page_id' => $data_page_id,
					'page_has_saved_version' => $has_saved_version,
					'page_is_online' => $is_online,
					'page_type' => $data_page_type,
					'item_zoneid' => $zoneIdTmp,
					'item_melisKey' => $pageMelisKey,
				)
			);

			array_push($final, $newpage);
		}

		return $final;
	}
981017
protected function calculateLinks($currentPage, $numberOfPages)
    {
        $baseUrl = $this->getBaseUrl();
        $prev = ($currentPage > 1) ? $currentPage - 1 : null;
        $next = ($currentPage < $numberOfPages) ? $currentPage + 1 : null;

        $separator = ($this->paginationLink) ? '/' : '?page=';

        return [
            'current' => $baseUrl.$separator.$currentPage,
            'prev' => ($prev) ? $baseUrl.$separator.$prev : null,
            'next' => ($next) ? $baseUrl.$separator.$next : null,
            'last' => ($numberOfPages > 0) ? $baseUrl.$separator.$numberOfPages : null,
        ];
    }
603641
public function getAttributeValues($page)
    {
        $values = $this->getAttributeValueRepository()->findBy([
            'cID' => $page->getCollectionID(),
            'cvID' => $page->getVersionID(),
        ]);

        return $values;
    }
1272482
protected function buildPageIdRootline($pageId, $mountPoint = '')
    {
        $rootlinePageIds = [];

            /** @var $pageSelector PageRepository */
        $pageSelector = GeneralUtility::makeInstance(PageRepository::class);
        $rootline = $pageSelector->getRootLine($pageId, (string)$mountPoint);

        foreach ($rootline as $page) {
            if (Site::isRootPage($page)) {
                break;
            }

            array_unshift($rootlinePageIds, $page['pid']);
        }

        $rootlinePageIds[] = $pageId;

        return $rootlinePageIds;
    }
137700
public function getPagedResults($limit = 25, $page = 0)
    {
        $template = self::DQL_ALL;
        $dql = sprintf($template, Application::class);

        return $this->getPaginator($dql, $limit, $page, []);
    }
410702
public function findMountPointPropertiesByPageIdOrByRootLineParentPageIds(int $mountedPageUid, array $rootLineParentPageIds = []) : array
    {
        if (array_filter($rootLineParentPageIds, 'is_int') !== $rootLineParentPageIds) {
            throw new \InvalidArgumentException('Given $rootLineParentPageIds array is not valid. Allowed only the arrays with the root line page UIDs as integers.', 1502459711);
        }

        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->select('uid', 'uid AS mountPageDestination', 'mount_pid AS mountPageSource', 'mount_pid_ol AS mountPageOverlayed')->from($this->table);
        $queryBuilder = $this->addWhereClauseForMountpointDestinationProperties($queryBuilder, $mountedPageUid, $rootLineParentPageIds);
        $result = $queryBuilder->execute()->fetchAll();
        return $result;
    }
221556
public function getSiteByPageId($pageId, $mountPointIdentifier = '')
    {
        $rootPageId = $this->rootPageResolver->getRootPageId($pageId, false, $mountPointIdentifier);
        return $this->getSiteByRootPageId($rootPageId);
    }
1193504
public function getPages($deep = false)
    {
        if ($this->has('Kids')) {

            if (!$deep) {
                return $this->get('Kids')->getContent();
            } else {
                $kids  = $this->get('Kids')->getContent();
                $pages = array();

                foreach ($kids as $kid) {

                    if ($kid instanceof Pages) {
                        $pages = array_merge($pages, $kid->getPages(true));
                    } else {
                        $pages[] = $kid;
                    }
                }

                return $pages;
            }
        }

        return array();
    }
149224
protected function getProjectList($page = 1, $perPage= 100)
    {
        $listRaw = $this->client->projects->accessible($page, $perPage);
        $list = [];
        foreach ($listRaw as $item) {
            if (array_get($item, 'namespace.name') === $this->namespace) {
                $list[] = $item;
            }
        }

        return $list;
    }
778661
public function getData($page)
    {
        $this->loadData();
        $start = ($page - 1) * $this->pageSize;

        return array_slice($this->filteredData, $start, $this->pageSize);
    }
1047276
public function getPages(Website $website, $pageIds, $isAdmin, $isAPI)
    {
        if (!is_array($pageIds)) {
            $pageIds = [$pageIds];
        }
        $pages = $this->pageRepository->findPages($website, $pageIds, $isAdmin, $isAPI);

        return $pages;
    }