public function setParent(Composite $parent) { $this->parentNode = $parent; if (!$parent->contains($this)) { $parent->append($this); } }