Пример #1
0
 public function addRole($role)
 {
     !$role instanceof Role && ($role = new Role($role));
     $role->addUser($this, false);
     $this->roles->add($role);
     return $this;
 }
Пример #2
0
 public function setParent(Role $parent, $addChildToParent = true)
 {
     $addChildToParent && $parent->addChildren($this, false);
     $this->parent = $parent;
 }