/** * {@inheritDoc} * * Shouldn't be called manually. */ public function setParent(IItem $item) { if (!$item->hasChild($this)) { throw new Exception('Please do not call this function manually. Parent assignation is managed automatically.'); } if ($item->equals($this)) { throw new Exception('Item can\'t be a child to itself'); } $this->parent = $item; return $this; }