Esempio n. 1
0
File: User.php Progetto: j7mbo/aurex
 /**
  * @param Role $role
  *
  * @return $this
  */
 public function addRole($role)
 {
     if (!$this->roles->contains($role)) {
         $this->roles->add($role);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Adds a Role to the Collection.
  *
  * @param  Role $role
  *
  * @return User
  */
 public function addRole(Role $role)
 {
     if (!$this->hasRole($role)) {
         $this->roles->add($role);
     }
     return $this;
 }
Esempio n. 3
0
 /**
  * @param Role $role
  *
  * @return $this
  */
 public function addAuthorizedRole(Role $role)
 {
     $this->authorizedRoles->add($role);
     return $this;
 }
Esempio n. 4
0
File: User.php Progetto: blitzik/CMS
 /**
  * @param Role $role
  */
 public function addRole(Role $role)
 {
     $this->roles->add($role);
 }
Esempio n. 5
0
 /**
  * @param Role $role
  */
 public function addRole(Role $role)
 {
     if (!$this->roles->contains($role)) {
         $this->roles->add($role);
     }
 }
Esempio n. 6
0
 /**
  * Replace the old platform roles of a user by a new array.
  *
  * @param $platformRoles
  */
 public function setPlatformRoles($platformRoles)
 {
     $roles = $this->getEntityRoles();
     $removedRoles = array();
     foreach ($roles as $role) {
         if ($role->getType() != Role::WS_ROLE) {
             $removedRoles[] = $role;
         }
     }
     foreach ($removedRoles as $removedRole) {
         $this->roles->removeElement($removedRole);
     }
     foreach ($platformRoles as $platformRole) {
         $this->roles->add($platformRole);
     }
 }
Esempio n. 7
0
 public function addChildren(Role $child, $setParentToChild = true)
 {
     $this->children->add($child);
     $setParentToChild && $child->setParent($this, false);
 }
Esempio n. 8
0
 /**
  * {@inheritdoc}
  */
 public function addRole(Role $role)
 {
     if (!$this->inRole($role)) {
         $this->roles->add($role);
     }
 }
Esempio n. 9
0
 /**
  * {@inheritdoc}
  */
 public function addAuthorizationRole(RoleInterface $role)
 {
     if (!$this->hasAuthorizationRole($role)) {
         $this->authorizationRoles->add($role);
     }
 }
Esempio n. 10
0
 /**
  * Add a child.
  *
  * @param  RoleInterface|string $child
  * @return RoleInterface
  */
 public function addChild($child)
 {
     $this->children->add($child);
     return $this;
 }
Esempio n. 11
0
 public function addRole(Movie $movie, $roles = null)
 {
     $roles = is_array($roles) ? $roles : [];
     $this->roles->add(new Role($this, $movie, $roles));
 }