public function registerRole(Role $role, $connect = TRUE) { $this->roles[$role->getId()] = $role; if ($connect) { $role->connectToParent($this->roles); if (!$role->hasParent()) { $this->rootRoles[$role->getId()] = $role; } } }
protected function findCircle(Role $role, Role $parent) { if ($role->getId() == $parent->getId()) { return TRUE; } else { if ($parent->hasParent()) { return $this->findCircle($role, $parent->getParent()); } else { return FALSE; } } }