This method finds out on which page are we (if any), from the list of
page object types on `return` annotation.

@return IPageObject
509449
protected function getNextPage()
	{
		$backtrace = debug_backtrace();
		return $this->getNextPageFromList(Utils::getReturnTypes($backtrace[1]['class'], $backtrace[1]['function']), $backtrace[1]['class']);
	}
403067
public function getCollectionPathObject()
    {
        $em = \ORM::entityManager();
        $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->cID;
        $path = $em->getRepository('\Concrete\Core\Entity\Page\PagePath')->findOneBy(
            ['cID' => $cID, 'ppIsCanonical' => true,
        ]);

        return $path;
    }
593704
public function indexAction() : object
    {
        $title = "Stylechooser";

        $page = $this->di->get("page");
        $session = $this->di->get("session");

        $active = $session->get(self::$key, null);

        $page->add("anax/stylechooser/index", [
            "styles" => $this->styles,
            "activeStyle" => $active,
            "activeShortDescription" => $this->styles[$active]["shortDescription"] ?? null,
            "activeLongDescription" => $this->styles[$active]["longDescription"] ?? null,
        ]);

        return $page->render([
            "title" => $title,
        ]);
    }
1286109
public function getPageCount()
    {
        if ($this->pageCount === null) {
            $catalog = $this->parser->getCatalog();

            $pages = PdfType::resolve(PdfDictionary::get($catalog, 'Pages'), $this->parser);
            $count = PdfType::resolve(PdfDictionary::get($pages, 'Count'), $this->parser);

            $this->pageCount = PdfNumeric::ensure($count)->value;
        }

        return $this->pageCount;
    }
729972
protected function getPageObject($sPageCode)
    {
        if (isset($this->arPageList[$sPageCode])) {
            return $this->arPageList[$sPageCode];
        }

        if (empty($sPageCode) || empty($this->obTheme)) {
            return null;
        }

        $this->arPageList[$sPageCode] = CmsPage::loadCached($this->obTheme, $sPageCode);

        return $this->arPageList[$sPageCode];
    }
448636
private function determinePageIdFromArguments()
    {
        if (empty($this->argumentNameOfPageId)) {
            return 0;
        }

        if (false === array_key_exists($this->argumentNameOfPageId, $this->restler->apiMethodInfo->arguments)) {
            return 0;
        }

        $index = $this->restler->apiMethodInfo->arguments[$this->argumentNameOfPageId];
        $pageId = (integer) $this->restler->apiMethodInfo->parameters[$index];
        return $pageId;
    }
700750
public function isTypeJavaScript()
    {
        $redirectType = $this->coreConfig->getConfigByPath(SgCoreInterface::PATH_REDIRECT_TYPE);

        return $redirectType->getValue() === SgCoreInterface::VALUE_REDIRECT_JS;
    }
801090
protected function visitorGetPageType($objPage)
	{
	    $PageId = $objPage->id;
	    //Return:
	    //0 = reale Seite / Reader ohne Parameter - Auflistung der News/FAQs
	    //1 = Nachrichten/News
	    //2 = FAQ
	    //403 = Forbidden
        
	    $page_type = self::PAGE_TYPE_NORMAL;
	    
	    if ($objPage->protected == 1) 
	    {
	    	//protected Seite. user 
	        $this->import('FrontendUser', 'User');
	        if (!$this->User->authenticate())
	        {
	            $page_type = self::PAGE_TYPE_FORBIDDEN;
	            ModuleVisitorLog::writeLog(__METHOD__ , __LINE__ , 'PageType: '. $page_type);
	            return $page_type;
	        }
	    }
	    
        //Set the item from the auto_item parameter
        //from class ModuleNewsReader#L48
        if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item']))
        {
        	\Input::setGet('items', \Input::get('auto_item'));
        }
        if (!\Input::get('items'))
        {
            ModuleVisitorLog::writeLog(__METHOD__ , __LINE__ , 'PageType: '. $page_type);
            return $page_type;
        }
	    
	    //News Table exists?
	    if (\Input::get('items') && \Database::getInstance()->tableExists('tl_news')) 
	    {
    	    //News Reader?
    	    $objReaderPage = \Database::getInstance()
                                ->prepare("SELECT id FROM tl_news_archive WHERE jumpTo=?")
                                ->limit(1)
                                ->execute($PageId);
    	    if ($objReaderPage->numRows > 0)
    	    {
    	        //News Reader
    	        $page_type = self::PAGE_TYPE_NEWS;
    	    }
	    }
	    
	    //FAQ Table exists?
	    if (\Input::get('items') && \Database::getInstance()->tableExists('tl_faq_category'))
	    {
	        //FAQ Reader?
	        $objReaderPage = \Database::getInstance()
                                ->prepare("SELECT id FROM tl_faq_category WHERE jumpTo=?")
                                ->limit(1)
                                ->execute($PageId);
	        if ($objReaderPage->numRows > 0)
	        {
	            //FAQ Reader
	            $page_type = self::PAGE_TYPE_FAQ;
	        }
	    }
	    
	    //Isotope Table tl_iso_product exists?
	    if (\Input::get('items') && \Database::getInstance()->tableExists('tl_iso_product'))
	    {
			$strAlias = \Input::get('items');
			ModuleVisitorLog::writeLog(__METHOD__ , __LINE__ , 'Get items: '. print_r($strAlias, true));			

	        $objReaderPage = \Database::getInstance()
                                ->prepare("SELECT id FROM tl_iso_product WHERE alias=?")
                                ->limit(1)
                                ->execute($strAlias);
			if ($objReaderPage->numRows > 0)
			{
	            //Isotope Reader
	            $page_type = self::PAGE_TYPE_ISOTOPE;
	        }
	    }
	    
	    ModuleVisitorLog::writeLog(__METHOD__ , __LINE__ , 'PageType: '. $page_type);
	    return $page_type;
	}
874390
protected function getPostTypeObject()
    {
        if ($this->postTypeObj === null) {
            $this->postTypeObj = get_post_type_object($this->getType());
        }

        return $this->postTypeObj;
    }
580557
public function getCollectionPathObject()
    {
        $db = Database::connection();
        $em = $db->getEntityManager();
        $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->cID;
        $path = $em->getRepository('\Concrete\Core\Page\PagePath')->findOneBy(
            array('cID' => $cID, 'ppIsCanonical' => true,
        ));

        return $path;
    }
790239
public function getHolderPage()
    {
        if (!$this->PageID && !$this->ElementID) return null;

        $holder = $this->getHolder();
        while (
            $holder
            && $holder->exists()
            && !is_a($holder, SiteTree::class)
        ) {
            $holder = $holder->getHolder();
        }

        return $holder;
    }
1289221
protected static function getSysPageObj()
    {
        if (self::$sysPageObj === null) {
            /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
            $objectManager = Typo3GeneralUtility::makeInstance(
                'TYPO3\\CMS\\Extbase\\Object\\ObjectManager'
            );

            /** @var \TYPO3\CMS\Frontend\Page\PageRepository $sysPageObj */
            $sysPageObj = $objectManager->get('TYPO3\\CMS\\Frontend\\Page\\PageRepository');

            self::$sysPageObj = $sysPageObj;
        }

        return self::$sysPageObj;
    }
877971
protected function getPage($page)
    {
        // Handle passed cID
        if (is_numeric($page)) {
            return Page::getByID($page);
        }

        // Handle passed /path/to/collection
        if (is_string($page)) {
            return Page::getByPath($page);
        }

        // If it's a page, just return the page
        if ($page instanceof Page) {
            return $page;
        }

        // If it's not a page but it's a collection, lets try getting a page by id
        if ($page instanceof Collection) {
            return $this->getPage($page->getCollectionID());
        }
    }
1321990
public Page findPageParameter(Object paramObj) {
    Page page = null;
    if (paramObj instanceof Page) {
      page = (Page) paramObj;
    } else if (paramObj instanceof Map) {
      Map m = (Map) paramObj;
      for (Object o : m.values()) {
        if (o instanceof Page) {
          page = (Page) o;
          break;
        }
      }
    }
    if (page != null) {
      PAGE_THREAD_LOCAL.set(page);
    }
    return page;
  }
1071613
public function getAllRawQuery($iPage = null, $iPerPage = null, $aData = [])
    {
        //  Fetch all objects from the table
        $oDb = Factory::service('Database');
        $oDb->select($this->sTableAlias . '.*');
        $oDb->select('ue.email,u.first_name,u.last_name,u.profile_img,u.gender');

        //  Apply common items; pass $aData
        $this->getCountCommonEvent($aData);

        // --------------------------------------------------------------------------

        //  Facilitate pagination
        if (!is_null($iPage)) {

            /**
             * Adjust the page variable, reduce by one so that the offset is calculated
             * correctly. Make sure we don't go into negative numbers
             */

            $iPage--;
            $iPage = $iPage < 0 ? 0 : $iPage;

            //  Work out what the offset should be
            $iPerPage = is_null($iPerPage) ? 50 : (int) $iPerPage;
            $iOffset  = $iPage * $iPerPage;

            $oDb->limit($iPerPage, $iOffset);
        }

        return $oDb->get($this->sTable . ' ' . $this->sTableAlias);
    }
1209511
public function getPage4Type($type)
    {
        $cachingKey = Caching::PAGE_INFO . '_' . $type;

        $pageInfo = $this->cachingHelperService->getItem($cachingKey, function () use ($type) {
            /** @var \PServerCore\Entity\Repository\PageInfo $repository */
            $repository = $this->entityManager->getRepository(
                $this->collectionOptions->getEntityOptions()->getPageInfo()
            );
            return $repository->getPageData4Type($type);
        });

        return $pageInfo;
    }
1194704
public function getPageMapper()
    {
        if (null === $this->pageMapper) {
            $this->pageMapper = $this->serviceLocator->get('playgroundcms_page_mapper');
        }

        return $this->pageMapper;
    }