src/Alchemy/Component/Cerberus/Model/Base/Role.php
public function addUser(ChildUser $user)
    {
        if ($this->collUsers === null) {
            $this->initUsers();
        }

        if (!$this->getUsers()->contains($user)) {
            // only add it if the **same** object is not already associated
            $this->collUsers->push($user);
            $this->doAddUser($user);
        }

        return $this;
    }
public function addUser(ChildUser $user)
    {
        if ($this->collUsers === null) {
            $this->initUsers();
        }

        if (!$this->getUsers()->contains($user)) {
            // only add it if the **same** object is not already associated
            $this->collUsers->push($user);
            $this->doAddUser($user);
        }

        return $this;
    }
public function addUser ( ChildUser $ user ) { if ( $ this -> collUsers === null ) { $ this -> initUsers ( ) ; } if ( ! $ this -> getUsers ( ) -> contains ( $ user ) ) { // only add it if the **same** object is not already associated $ this -> collUsers -> push ( $ user ) ; $ this -> doAddUser ( $ user ) ; } return $ this ; }
Associate a ChildUser to this object
through the user_role cross reference table.

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