/** * Sets up the tag of this node. * * @param $tag */ public function __construct($tag) { if (!$tag instanceof Tag) { $tag = new Tag($tag); } $this->tag = $tag; parent::__construct(); }
/** * Sets the parent node. * * @param InnerNode $parent * @return $this * @throws CircularException */ public function setParent(InnerNode $parent) { // check integrity if ($this->isDescendant($parent->id())) { throw new CircularException('Can not add descendant "' . $parent->id() . '" as my parent.'); } return parent::setParent($parent); }