Return the origin of the page by id

return array
511734
public function getOriginOfPageByPageIdAction()
    {
        $data = array();
        $tool = $this->getServiceLocator()->get('MelisCmsPage');
        $data = $tool->getOriginOfPage()->toArray();

        return $data;

    }
778432
def get(self, obj_id):
        
        if BasicPage.PAGE_ID_SEPARATOR in obj_id:
            (docid, page_nb) = obj_id.split(BasicPage.PAGE_ID_SEPARATOR)
            page_nb = int(page_nb)
            return self._docs_by_id[docid].pages[page_nb]
        return self._docs_by_id[obj_id]
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;
    }
1169901
function getdata($page = 1, $length = 10, $ano = false, $mes = false, $dia = false)
    {
        
        $dt = [];
        $where = '';
        
        if ($ano !== false) {
            $where .= ' AND YEAR(data) = :ano ';
            $dt[':ano'] = $ano;
        }
        
        if ($mes !== false) {
            $where .= ' AND MONTH(data) = :mes ';
            $dt[':mes'] = $mes;
        }

        if ($dia !== false) {
            $where .= ' AND DAY(data) = :dia ';
            $dt[':dia'] = $dia;
        }

        //Calculando a página
        $data = $this->calculate($page, $length,
                                'SELECT id								 
								 FROM access								 
								 WHERE (uri LIKE "/a/%" 
								 OR uri = "/")
								 '.$where.'								 
								 GROUP BY uri, MONTH(data), DAY(data)', $dt);

        return $this->execute($data,
                                'SELECT data, COUNT(id)qt, uri AS Link 
								 FROM access
     							 WHERE (uri LIKE "/a/%" 
								 OR uri = "/")
								 '.$where.'
								 GROUP BY uri, MONTH(data), DAY(data)
								 ORDER BY DAY(data), uri
								 LIMIT '.$data['init'].', '.$data['length'], $dt);
    }
678818
public function exportById($id): array
    {
        $site = Craft::$app->sites->getSiteById((int) $id);

        return $this->export($site);
    }
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;
    }
1180304
def get_page_ancestors(self, page_id):
        
        url = 'rest/api/content/{page_id}?expand=ancestors'.format(page_id=page_id)
        return (self.get(path=url) or {}).get('ancestors')
479763
def get_page_from_string_or_id(page_string, lang=None):
    """"""
    if type(page_string) == int:
        return Page.objects.get(pk=int(page_string))
    # if we have a string coming from some templates templates
    if (isinstance(page_string, SafeText) or
            isinstance(page_string, str)):
        if page_string.isdigit():
            return Page.objects.get(pk=int(page_string))
        return Page.objects.from_path(page_string, lang)
    # in any other case we return the input becasue it's probably
    # a Page object.
    return page_string
830185
def origin_id_to_name(self, origin):
        
        try:
            oid = int(origin)
        except (ValueError, TypeError):
            return None

        return self.origins.get(oid)
769543
public function getParentPageIds()
    {
        $rootLineParentPageIds = [];
        if (empty($this->rootLineArray)) {
            // no rootline given
            return $rootLineParentPageIds;
        }

        foreach ($this->rootLineArray as $pageRecord) {
            $rootLineParentPageIds[] = $pageRecord['uid'];
            if (Site::isRootPage($pageRecord)) {
                break;
            }
        }

        return $rootLineParentPageIds;
    }
458611
function origin (node) {
  const ownWindow = ownerWindow(node)

  const { location } = ownWindow


  if (location.protocol === 'file:') {
    return '*'
  } else if (location.origin) {
    return location.origin
  } else if (location.port) {
    return `${location.protocol}//${location.hostname}:${location.port}`
  } else {
    return `${location.protocol}//${location.hostname}`
  }
}
40955
def _check_cors_origin(origin, allowed_origins):
    '''
    
    '''
    if isinstance(allowed_origins, list):
        if origin in allowed_origins:
            return origin
    elif allowed_origins == '*':
        return allowed_origins
    elif allowed_origins == origin:
        # Cors origin is either * or specific origin
        return allowed_origins
850181
public function origins()
    {
        if (is_null($this->originRequests)) {
            $this->originRequests = new OriginRequests($this->client);
        }

        return $this->originRequests;
    }
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;
    }
744943
def origin(self):
        '''
        
        '''
        try:
            return self._origin
        except AttributeError:
            pass
        self._origin = Point()
        return self._origin
281864
def get_page_by_id(self, page_id, expand=None):
        
        url = 'rest/api/content/{page_id}?expand={expand}'.format(page_id=page_id, expand=expand)
        return self.get(url)
983561
private static function prepareOrigin()
    {
        $origin = App::getDomain();
        
        if (!$origin) {
          $origin = (isset($_SERVER["REQUEST_SCHEME"]) ? $_SERVER["REQUEST_SCHEME"] : "http" . (isset($_SERVER["HTTPS"]) ? "s" : "")) . "://" . (isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : $_SERVER["SERVER_NAME"]);
        }
        
        return $origin;
    }