Beispiel #1
0
 /**
  * @param Role $role
  *
  * @return $this
  */
 public function removeAuthorizedRole(Role $role)
 {
     $this->authorizedRoles->removeElement($role);
     return $this;
 }
Beispiel #2
0
 /**
  * Remove the Role object from collection
  *
  * @param  Role|string $role
  *
  * @throws \InvalidArgumentException
  */
 public function removeRole($role)
 {
     if ($role instanceof Role) {
         $roleObject = $role;
     } elseif (is_string($role)) {
         $roleObject = $this->getRole($role);
     } else {
         throw new \InvalidArgumentException('$role must be an instance of Oro\\Bundle\\UserBundle\\Entity\\Role or a string');
     }
     if ($roleObject) {
         $this->roles->removeElement($roleObject);
     }
 }
Beispiel #3
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);
     }
 }
Beispiel #4
0
 /**
  * @param Role $role
  */
 public function removeRole(Role $role)
 {
     $this->roles->removeElement($role);
 }
Beispiel #5
0
 /**
  * Remove children
  *
  * @param \Bigfish\Bundle\UserBundle\Entity\Role $children
  */
 public function removeChild(\Bigfish\Bundle\UserBundle\Entity\Role $children)
 {
     $this->children->removeElement($children);
 }
Beispiel #6
0
 /**
  * {@inheritdoc}
  */
 public function removeAuthorizationRole(RoleInterface $role)
 {
     if ($this->hasAuthorizationRole($role)) {
         $this->authorizationRoles->removeElement($role);
     }
 }
Beispiel #7
0
 /**
  * Remove role
  *
  * @param \AppBundle\Entity\Role $role
  */
 public function removeRole(\AppBundle\Entity\Role $role)
 {
     $this->roles->removeElement($role);
 }
Beispiel #8
0
 public function removeChildren(Role $children)
 {
     $this->children->removeElement($children);
 }
Beispiel #9
0
 /**
  * Remove child
  *
  * @param \Fp\UserBundle\Entity\Role $child
  */
 public function removeChild(\Fp\UserBundle\Entity\Role $child)
 {
     $this->children->removeElement($child);
 }