src/Slashworks/BackendBundle/Model/om/BaseRole.php
public function addUserRole(UserRole $l)
    {
        if ($this->collUserRoles === null) {
            $this->initUserRoles();
            $this->collUserRolesPartial = true;
        }

        if (!in_array($l, $this->collUserRoles->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
            $this->doAddUserRole($l);

            if ($this->userRolesScheduledForDeletion and $this->userRolesScheduledForDeletion->contains($l)) {
                $this->userRolesScheduledForDeletion->remove($this->userRolesScheduledForDeletion->search($l));
            }
        }

        return $this;
    }
public function addUserRole(UserRole $l)
    {
        if ($this->collUserRoles === null) {
            $this->initUserRoles();
            $this->collUserRolesPartial = true;
        }

        if (!in_array($l, $this->collUserRoles->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
            $this->doAddUserRole($l);

            if ($this->userRolesScheduledForDeletion and $this->userRolesScheduledForDeletion->contains($l)) {
                $this->userRolesScheduledForDeletion->remove($this->userRolesScheduledForDeletion->search($l));
            }
        }

        return $this;
    }
public function addUserRole ( UserRole $ l ) { if ( $ this -> collUserRoles === null ) { $ this -> initUserRoles ( ) ; $ this -> collUserRolesPartial = true ; } if ( ! in_array ( $ l , $ this -> collUserRoles -> getArrayCopy ( ) , true ) ) { // only add it if the **same** object is not already associated $ this -> doAddUserRole ( $ l ) ; if ( $ this -> userRolesScheduledForDeletion and $ this -> userRolesScheduledForDeletion -> contains ( $ l ) ) { $ this -> userRolesScheduledForDeletion -> remove ( $ this -> userRolesScheduledForDeletion -> search ( $ l ) ) ; } } return $ this ; }
Method called to associate a UserRole object to this object
through the UserRole foreign key attribute.

@param    UserRole $l UserRole
@return Role The current object (for fluent API support)
Method called to associate a UserRole object to this object through the UserRole foreign key attribute .