public function addChild($role) { $child = $role instanceof Role ? $role : new Role($role); $child->setParent($this); $this->children[] = $child; return $this; }