public function __construct(Page $startingParentPage, Page $currentPage = null) { parent::__construct(); $this->startingParentPage = $startingParentPage; if (is_object($currentPage)) { $this->trail = array($currentPage->getCollectionID()); $cParentID = Page::getCollectionParentIDFromChildID($currentPage->getCollectionID()); while ($cParentID > 0) { $this->trail[] = $cParentID; $cParentID = Page::getCollectionParentIDFromChildID($cParentID); } } // pop off the dashboard node array_pop($this->trail); $this->currentPage = $currentPage; }
/** * Get the Parent cID from a page by using a cID. * * @param int $cID * * @return int */ public function getCollectionParentIDFromChildID($cID) { return parent::getCollectionParentIDFromChildID($cID); }