public function getParent() { if ($this->parent === null) { $this->setParent(Document::getById($this->getParentId())); } return $this->parent; }