concrete/src/Page/Search/Index/PageIndexer.php
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());
        }
    }
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());
        }
    }
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 ( ) ) ; } }
Get a page based on criteria
@param string|int|Page|Collection $page
@return \Concrete\Core\Page\Page
Get a page based on criteria