Seek the first available page from descendants
@return Content|null
485601
public function seekFirstPage()
    {
        if ($this instanceof self) {
            $index_key = $this->getConfig()['index_key'];
            if (isset($this->children[$index_key])) {
                return $this->children[$index_key];
            }
            foreach ($this->children as $node_key => $node) {
                if ($node instanceof Content) {
                    return $node;
                }
                if ($node instanceof self
                && strpos($node->getUri(), '.') !== 0
                && $childNode = $node->seekFirstPage()) {
                    return $childNode;
                }
            }
        }

        return null;
    }
1237237
public function getContentLibrary()
    {
        return $this->contentLibrary == null ?
            $this->contentLibrary = new PageContentLibraryImpl($this->container, $this) :
            $this->contentLibrary;
    }
1174900
public function getFirstChild()
	{
		$xpathStr = self::XPATH_THIS . '*[1]';
		$results = $this->xpath($xpathStr);
		if (count($results) >= 1) {
			return $results[0];
		}
		return null;
	}
189487
public function first()
    {
        $sql = clone($this);
        $sql->limit(1);
        $collection = $this->query($sql);
        return $collection->isEmpty() ? null : $collection[0];
    }
1219377
public function isFirst()
    {
        $node = $this->node;
        return $node->index === 'content'
            || isset($node->position) && $node->position === 1;
    }
2119
public function prev()
    {
        return $this->getParent() !== null ? $this->getParent()->getChildByIndex($this->getIndex() - 1) : null;
    }
1310329
public function prev()
    {

        $index = $this->parent->indexOf($this) - 1;

        return isset($this->parent->children[$index]) ? $this->parent->children[$index] : null;
    }
1044535
protected function getNext() {
		if ($this->get('page')< $this->pageTotal) {
			return $this->replaceLine($this->get('page')+ 1, $this->get('next'));
		}
		return null;
	}
424033
public function getLast()
    {
        if ($this->isEmpty()) {
            return null;
        }

        $this->seek(count($this->positions) - 1);

        return $this->current();
    }
157704
public function findSection() {
		$page = $this;
		while ($page && $page->ID) {
			if ($page->ParentID == 0 || $page->PrimaryNewsSection) {
				return $page;
			}
			$page = $page->Parent();
		}
	}
729793
public static function setHomepage()
    {
        if(!self::$homepage) {
            $findHomePage = null;
            if (settings('homepageID')) {
                $findHomePage = (new Post())->setTable("post_pages")
                    ->where('postID', settings('homepageID'))
                    ->first();
            }

            // get the first found page if no homepage is defined
            if (!$findHomePage) {
                $findHomePage = (new Post())->setTable("post_pages")->first();
            }

            if(!$findHomePage) {
                throw new \Exception("No homepage found. Please add a page post!");
            }
            self::$homepage = $findHomePage;

        }

        return self::$homepage;
    }
786741
public function getBaseHref()
    {
        $node = $this->filterXPath('descendant-or-self::base')->getNode(0);
        if ($node instanceof \DOMElement) {
            return $node->getAttribute('href');
        } else {
            return null;
        }
    }
772054
public function getFirst()
    {
        $first = null;

        if (count($this->renderers) > 0) {
            $first = reset($this->renderers);
        }

        return $first;
    }
1090170
private Page seek() {
    Page prev = next;
    next = null;
    while (resources.hasNext() && next == null) {
      Resource nextResource = resources.next();
      next = nextResource.adaptTo(Page.class);

      if (next == null) {
        // handle sling:Folder and sling:OrderedFolder as "virtual pages" to allow browsing pages below them
        String primaryType = nextResource.getValueMap().get(JcrConstants.JCR_PRIMARYTYPE, String.class);
        if (StringUtils.equals(primaryType, "sling:Folder") || StringUtils.equals(primaryType, "sling:OrderedFolder")) {
          next = new SlingFolderVirtualPage(nextResource);
        }
      }

      if (next != null && pageFilter != null && !pageFilter.includes(next)) {
        next = null;
      }
    }
    return prev;
  }
579021
public function findFirst()
    {
        $rowset = $this->getTableGateway()
            ->select(
                function(Select $select) {
                    $select->columns($this->columns);
                    $select->limit(1);
                    $select->order('id asc');
                }
            );
        $row = $rowset->current();
        if (!$row) {
            return NULL;
        }
        return $row;
    }
572180
protected function get_firstpageid() {
        global $DB;
        if ($this->firstpageid == null) {
            if (!$this->loadedallpages) {
                $firstpageid = $DB->get_field('lesson_pages', 'id', array('lessonid'=>$this->properties->id, 'prevpageid'=>0));
                if (!$firstpageid) {
                    print_error('cannotfindfirstpage', 'lesson');
                }
                $this->firstpageid = $firstpageid;
            } else {
                $firstpage = $this->get_firstpage();
                $this->firstpageid = $firstpage->id;
            }
        }
        return $this->firstpageid;
    }
816111
public function getFirst()
    {
        if (0 === count($this->data)) {
            return null;
        }
        reset($this->data);

        return current($this->data);
    }