public function setParent(Subject $parent = null) { $this->parent = $parent; if ($parent) { $parent->addChild($this); } return $this; }