src/Alchemy/Component/Cerberus/Model/Base/Role.php
public function removeUser(ChildUser $user)
    {
        if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();

            $userRole->setUser($user);
            if ($user->isRolesLoaded()) {
                //remove the back reference if available
                $user->getRoles()->removeObject($this);
            }

            $userRole->setRole($this);
            $this->removeUserRole(clone $userRole);
            $userRole->clear();

            $this->collUsers->remove($this->collUsers->search($user));

            if (null === $this->usersScheduledForDeletion) {
                $this->usersScheduledForDeletion = clone $this->collUsers;
                $this->usersScheduledForDeletion->clear();
            }

            $this->usersScheduledForDeletion->push($user);
        }


        return $this;
    }
public function removeUser(ChildUser $user)
    {
        if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();

            $userRole->setUser($user);
            if ($user->isRolesLoaded()) {
                //remove the back reference if available
                $user->getRoles()->removeObject($this);
            }

            $userRole->setRole($this);
            $this->removeUserRole(clone $userRole);
            $userRole->clear();

            $this->collUsers->remove($this->collUsers->search($user));

            if (null === $this->usersScheduledForDeletion) {
                $this->usersScheduledForDeletion = clone $this->collUsers;
                $this->usersScheduledForDeletion->clear();
            }

            $this->usersScheduledForDeletion->push($user);
        }


        return $this;
    }
public function removeUser ( ChildUser $ user ) { if ( $ this -> getUsers ( ) -> contains ( $ user ) ) { $ userRole = new ChildUserRole ( ) ; $ userRole -> setUser ( $ user ) ; if ( $ user -> isRolesLoaded ( ) ) { //remove the back reference if available $ user -> getRoles ( ) -> removeObject ( $ this ) ; } $ userRole -> setRole ( $ this ) ; $ this -> removeUserRole ( clone $ userRole ) ; $ userRole -> clear ( ) ; $ this -> collUsers -> remove ( $ this -> collUsers -> search ( $ user ) ) ; if ( null === $ this -> usersScheduledForDeletion ) { $ this -> usersScheduledForDeletion = clone $ this -> collUsers ; $ this -> usersScheduledForDeletion -> clear ( ) ; } $ this -> usersScheduledForDeletion -> push ( $ user ) ; } return $ this ; }
Remove user of this object
through the user_role cross reference table.

@param ChildUser $user
@return ChildRole The current object (for fluent API support)
Remove user of this object through the user_role cross reference table .