/** * Set the parent role * * @param AclRole $parent * @return AclRole */ public function setParent(AclRole $parent) { if ($parent->getName() !== $this->getName()) { $this->parent = $parent; $this->parent->addChild($this); } return $this; }