/** * Adds a subpage. * * @param self $subpage * * @return $this */ public function addSubpage(self $subpage) { $this->subpages[$subpage->getKey()] = $subpage; $subpage->parent = $this; $subpage->setParentKey($this->getFullKey()); return $this; }