Inheritance: extends AbstractNode, implements IteratorAggregat\IteratorAggregate, implements Countabl\Countable
Beispiel #1
0
 /**
  * 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();
 }
Beispiel #2
0
 /**
  * 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);
 }