Get the url to download the page url from

@param string $pageId

@return array
352001
public function getSinglePageDownloadUrl($pageId)
    {
        try {
            $response = $this->client->get($this->PagesUrl . '/' . $pageId, [
                'headers' => ['Authorization' => 'Bearer '. $this->login->apiKey],
                'verify' => $this->certFile,
            ]);

            $body = json_decode($response->getBody(), true);
            $url = $body['_meta']['publishUrl'];
            $responseText = ['url' => $url];

            $response = [
                'code' => '200',
                'response' => json_encode($responseText),
                'error' => false
            ];

        } catch (ClientException $e) {
            $httpResponse = $e->getResponse();
            // 404 means their Leadpage in their account probably got deleted
            if ($httpResponse->getStatusCode() == 404) {
                $response = [
                    'code' => $httpResponse->getStatusCode(),
                    'response' => "
                    Your Leadpage could not be found! Please make sure it is published in your Leadpages Account <br />
                    <br />
                    Support Info:<br />
                    <strong>Page id:</strong> {$pageId} <br />
                    <strong>Page url:</strong> {$this->PagesUrl}/{$pageId}",
                    'error' => true
                ];

            } else {
                $message = 'Something went wrong, please contact Leadpages support.';
                $response = $this->parseException($e);
            }

        } catch (ServerException $e) {
            $response = $this->parseException($e);

        } catch (ConnectException $e) {
            $message = 'Can not connect to Leadpages Server:';
            $response = $this->parseException($e, $message);

        } catch (RequestException $e) {
            $response = $this->parseException($e);
        }

        return $response;
    }
1117619
public static function getUrlByMenuId($menuId)
    {
        $record = static::find()
            ->findByMenuId($menuId)
            ->innerJoinWith('menuUrl')
            ->one();

        $return = [];
        if ($record) {
            $return = $record->getMenuUrlData();
        }

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

    }
854115
public function getPage($pageId)
    {
        if (!empty($this->pages[$pageId])) {
            return $this->pages[$pageId];
        } else {
            throw new HTML_QuickForm2_NotFoundException(
                "Unknown page '{$pageId}'"
            );
        }
    }
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;
        }
    }
482988
public function getListUrl($id)
    {
        $xPath = new DOMXPath($this->getDomXml());
        $nodeList = $xPath->query("//SUBMENU[@cl='{$id}']");
        if ($nodeList->length && ($node = $nodeList->item(0))) {
            $cl = $node->getAttribute('list');
            $cl = $cl ? "cl=$cl" : '';

            $params = $node->getAttribute('listparam');
            $params = $params ? "&$params" : '';

            return "{$cl}{$params}";
        }
    }
297679
public function getCurrentPage($contextId = null)
    {
        $pager = $this->offsetGet($contextId) ?: $this->offsetGet('');

        return ($pager) ? $pager->current : 1;
    }
911504
public function getSiteDetails($siteId)
    {
        if ($this->connector->getURL() === null) {
            return 'Cannot find site URL from configuration.';
        }
        $url = $this->connector->getURL().self::VERSION.$siteId;
        $params = [];
        $response = $this->connector->connecting($url, $params, 'GET');

        return $response;
    }
579270
public function getCollectionPages($collectionId)
    {
        $pageMapper = ($this->container->dataMapper)('PageMapper');

        // Page Collection
        $data = $pageMapper->findCollectionPagesById($collectionId);

        return $data;
    }
898915
public function url_page($page_slug = '', $page_id = '')
    {
        $url = $this->siteUrl('pages/' . trim($page_slug) . '-page' . $this->encodeId(trim($page_id)));

        return $url;
    }
163870
public static function getIsSiteManagedSite($pageId)
    {

        $siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
        try {
            $site = $siteFinder->getSiteByPageId($pageId);
        } catch (SiteNotFoundException $e) {
            return false;
        }

        return $site instanceof Site;
    }
1252004
public function findByPageIdAndByLanguageId($pageId, $languageId)
    {
        try {
            $this->initializeSearch($pageId, $languageId);
            $pageQuery = $this->queryBuilder->buildPageQuery($pageId);
            $response = $this->search->search($pageQuery, 0, 10000);
        } catch (NoSolrConnectionFoundException $exception) {
            return [];
        } catch (SolrCommunicationException $exception) {
            return [];
        }
        $data = $response->getParsedData();
        return $this->documentEscapeService->applyHtmlSpecialCharsOnAllFields($data->response->docs ?? []);
    }
270815
public static function generatePageUrl($uid)
    {
        $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
        $conf = [
            'parameter' => intval($uid),
            'linkAccessRestrictedPages' => '1',
            'useCacheHash' => 1,
            'returnLast ' => 'url',
            'forceAbsoluteUrl' => 1
        ];
        $language = GeneralUtility::_GET('L');
        if (!empty($language)) {
            $conf['additionalParams'] = '&L=' . $language;
        }
        $url = $contentObject->typoLink_URL($conf);

        // clean up
        if ($url == '') {
            $url = '/';
        }

        return $url;
    }
303850
public static function getOrderedPages($pageIds)
    {
        $pages = [];
        foreach ($pageIds as $pageId) {
            $pages[$pageId] = static::preload($pageId);
        }
        uasort($pages, ['self', '_orderAsc']);
        return $pages;
    }
832935
public function getFilterableListInstanceIdOnPage($pageId)
    {
        // find module instances of type x on page with setting y
        $query = "SELECT `shop_module_article_list`.`cms_tpl_module_instance_id`
                    FROM `shop_module_article_list`
              INNER JOIN `cms_tpl_page_cms_master_pagedef_spot` ON `shop_module_article_list`.`cms_tpl_module_instance_id` = `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_module_instance_id`
                   WHERE `shop_module_article_list`.`can_be_filtered` = '1'
                     AND `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_page_id` = :pageId
                 ";
        $instanceData = $this->getDatabaseConnection()->fetchArray($query, array('pageId' => $pageId));
        if (false === $instanceData) {
            return null;
        }

        return $instanceData[0];
    }
1336279
protected function getDbRoutes($siteId = null): array
    {
        if ($siteId === null) {
            $siteId = Craft::$app->getSites()->currentSite->id;
        }
        if ($siteId === 'global') {
            $siteId = null;
        }
        // If we're on Craft 3.1 or later, just return the array from getProjectConfigRoutes();
        if (RouteMap::$craft31) {
            return Craft::$app->getRoutes()->getProjectConfigRoutes();
        }

        // Normalize the URL
        $results = (new Query())
            ->select(['uriPattern', 'template'])
            ->from(['{{%routes}}'])
            ->where([
                'or',
                ['siteId' => $siteId],
            ])
            ->orderBy(['sortOrder' => SORT_ASC])
            ->all();

        return ArrayHelper::map($results, 'uriPattern', function ($results) {
            return ['template' => $results['template']];
        });
    }
1057384
public function offsetGet($contextId)
    {
        $ctxkey = $this->makeParameterId($contextId);
        if (array_key_exists($ctxkey, $this->pagers)) {
            return $this->pagers[$ctxkey];
        }

        return false;
    }