Get meta data from given ID page

@param number $pageId
@return array
359098
private function getPageMetas($pageId)
    {
        $pageMetas = array();
        $metas = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMeta')->findByPage($pageId);
        foreach ($metas as $meta)
        {
            $pageMetas[$meta->getMetaKey()] = $meta;
        }
        return $pageMetas;
    }
872242
public function findForBackend($pageId, $displayMode): array
    {
        $queryBuilder = $this->createQuery();

        $where = [];
        switch ($displayMode) {
            case 'current':
                $where[] = $queryBuilder->expr()->eq('uid', $pageId);
                break;
            case 'childs':
                $where[] = $queryBuilder->expr()->eq('pid', $pageId);
                break;
            case 'both':
                $where[] = $queryBuilder->expr()->eq('uid', $pageId);
                $where[] = $queryBuilder->expr()->eq('pid', $pageId);
                break;
        }

        return (array)$queryBuilder->select('*')
            ->from('pages')
            ->orWhere(...$where)
            ->execute()
            ->fetchAll();
    }
612665
protected function getPageId($pid)
    {
        $pid = (int)$pid;
        if ($pid > 0) {
            return $pid;
        }
        $row = BackendUtilityCore::getRecord('tt_content', abs($pid), 'uid,pid');
        return $row['pid'];
    }
995238
protected function getPageEditLink($pageId, $documentSetId)
    {
        return Controller::join_links(
            CMSPageEditController::singleton()->getEditForm($pageId)->FormAction(),
            'field/DocumentSets/item',
            (int) $documentSetId
        );
    }
160787
private function getSubPagesRecursive($rootPageId)
    {
        $pages = $this->getSubPages($rootPageId);
        foreach ($pages as $page) {
            if (false === $this->isPageTreeLeaf($page)) {
                ArrayUtility::mergeRecursiveWithOverrule(
                    $pages,
                    $this->getSubPagesRecursive($page['uid'])
                );
            }
        }

        return $pages;
    }
863387
public function getMetadata($locationId)
    {
        if (strlen($locationId) !== 6 || !Regex::match("/[0-9]{6}/", $locationId)->hasMatch()) {
            throw new \InvalidArgumentException('locationId must be a id out of 6 numbers');
        }

        $url = "/etc/designs/meteoswiss/ajax/location/$locationId.json";

        $result = collect($this->makeRequest($url, true));

        return [
            'location_id' => $result['location_id'],
            'city_name' => $result['city_name'],
            'postal_code' => substr($result['location_id'], 0, 4),
            'station_id' => $result['station_id'],
            'webcam_id' => $result['webcam_id'],
        ];
    }
542762
protected function getTemplatePathFromTypoScriptOfPage($pageId)
    {
        /** @var TemplateService $template */
        $template = GeneralUtility::makeInstance(TemplateService::class);
        // do not log time-performance information
        $template->tt_track = false;
        $template->init();

        /** @var PageRepository $sys_page */
        $sys_page = GeneralUtility::makeInstance(PageRepository::class);
        $rootLine = $sys_page->getRootLine((int)$pageId);
        // generate the constants/config + hierarchy info for the template.
        $template->runThroughTemplates($rootLine);
        $template->generateConfig();

        // get value for the path containing the template files
        return GeneralUtility::getFileAbsFileName($template->setup['plugin.']['tx_ttaddress_pi1.']['templatePath']);
    }
33885
protected function pageResourceMapper($resourceId)
    {
        if (!$this->resourceName->isPagesResourceId($resourceId)) {
            return null;
        }

        $resources = explode('.', $resourceId);

        if (empty($resources[1])) {
            return null;
        }

        $siteResourceId = $this->resourceName->get(self::RESOURCE_SITES, $resources[1]);

        $return = [
            'resourceId' => $resourceId,
            'parentResourceId' => $siteResourceId,
        ];

        if ($this->resourceName->isPageResourceId($resourceId)) {
            $pagesResourceId = $this->resourceName->get(self::RESOURCE_SITES, $resources[1], self::RESOURCE_PAGES);
            $return['parentResourceId'] = $pagesResourceId;
        }

        return array_merge(
            $this->resources[self::RESOURCE_PAGES],
            $return
        );
    }
223727
public function findPageById($pageId)
    {
        $this->makeCollectionPageSelect(true);
        $this->sql .= ' and p.id = ?';
        $this->bindValues[] = $pageId;

        return $this->findRow();
    }
241729
public function findLastPageSnapshot($pageId)
    {
        $qb = $this->createQueryBuilder('ps')
            ->where('ps.page = :pageId')
            ->orderBy('ps.version', 'desc')
            ->setMaxResults(1)
            ->setParameter(':pageId', $pageId);

        try {
            return $qb->getQuery()->getSingleResult();
        } catch (NoResultException $e) {
            return null;
        } catch (NonUniqueResultException $e) {
            return null;
        }
    }
1213737
public function get_next_page($nextpageid) {
        global $USER, $DB;
        $allpages = $this->load_all_pages();
        if ($this->properties->nextpagedefault) {
            // in Flash Card mode...first get number of retakes
            $nretakes = $DB->count_records("lesson_grades", array("lessonid" => $this->properties->id, "userid" => $USER->id));
            shuffle($allpages);
            $found = false;
            if ($this->properties->nextpagedefault == LESSON_UNSEENPAGE) {
                foreach ($allpages as $nextpage) {
                    if (!$DB->count_records("lesson_attempts", array("pageid" => $nextpage->id, "userid" => $USER->id, "retry" => $nretakes))) {
                        $found = true;
                        break;
                    }
                }
            } elseif ($this->properties->nextpagedefault == LESSON_UNANSWEREDPAGE) {
                foreach ($allpages as $nextpage) {
                    if (!$DB->count_records("lesson_attempts", array('pageid' => $nextpage->id, 'userid' => $USER->id, 'correct' => 1, 'retry' => $nretakes))) {
                        $found = true;
                        break;
                    }
                }
            }
            if ($found) {
                if ($this->properties->maxpages) {
                    // check number of pages viewed (in the lesson)
                    if ($DB->count_records("lesson_attempts", array("lessonid" => $this->properties->id, "userid" => $USER->id, "retry" => $nretakes)) >= $this->properties->maxpages) {
                        return LESSON_EOL;
                    }
                }
                return $nextpage->id;
            }
        }
        // In a normal lesson mode
        foreach ($allpages as $nextpage) {
            if ((int)$nextpage->id === (int)$nextpageid) {
                return $nextpage->id;
            }
        }
        return LESSON_EOL;
    }
216828
public function get($pageId, array $params = array())
    {
        $endpoint = '/admin/pages/'.$pageId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Page::class, $response['page']);
    }
156417
public function getPageSuggestions($pageID, $limit = 0, $approved = true) {

		// Make sure the current user has appropriate permission.

		$pageID = (int)$pageID;
		if(($page = ExtensibleSearchPage::get_by_id(ExtensibleSearchPage::class, $pageID)) && $page->canView()) {

			// Retrieve the search suggestions.

			$suggestions = ExtensibleSearchSuggestion::get()->filter(array(
				'Approved' => (int)$approved,
				'ExtensibleSearchPageID' => $pageID
			))->sort('Frequency', 'DESC');
			if($limit) {
				$suggestions = $suggestions->limit($limit);
			}

			// Make sure the search suggestions are unique.

			return $suggestions->column('Term');
		}
		return array();
	}
1194855
public function getSeoKeywordsByPageId($pageId)
    {
        $pageId = $this->params()->fromRoute('idPage', $this->params()->fromQuery('idPage', ''));
        $data = array();

        $seoKeywords = $pageId->getSeoKeywords($pageId);
        $data        = $seoKeywords;

        return $data;
    }
1057358
public function getValidationStatus($pageId)
    {
        return array_key_exists($pageId, $this->data['valid'])
               ? $this->data['valid'][$pageId]: null;

    }
1024789
private function getBreadcrumbTrail($nodeId)
    {
        $pages = [];
        $pageId = $nodeId;

        do {
            $page = PageModel::findByPk($pageId);

            if (null === $page) {
                // Currently selected page does not exits
                if ($pageId === $nodeId) {
                    return [];
                }

                break;
            }

            $pages[] = $page;

            // Do not show the mounted pages
            if (!$this->user->isAdmin && $this->user->hasAccess($page->id, 'pagemounts')) {
                break;
            }

            $pageId = $page->pid;
        } while ($pageId > 0);

        return $pages;
    }
1050800
protected function getAcfFromPage(int $pageId): array
    {
        $data = [];
        try {
            $data = $this->wpProvider->getFields($pageId);
        } catch (\Throwable $e) {
            ;
        }

        if (!is_array($data) || empty($data)) return [];

        return $data;
    }