public function addRole($rrid, $label)
    {
        if (!is_integer($rrid)) {
            throw new \InvalidArgumentException("The relative role identifier must be an integer.");
        }
        if (isset($this->roles[$rrid])) {
            throw new \LogicException(sprintf("This relative role identifier is already used (%d).", $rrid));
        }

        $this->roles[$rrid] = $label;
        return $this;
    }
public function addRole($rrid, $label)
    {
        if (!is_integer($rrid)) {
            throw new \InvalidArgumentException("The relative role identifier must be an integer.");
        }
        if (isset($this->roles[$rrid])) {
            throw new \LogicException(sprintf("This relative role identifier is already used (%d).", $rrid));
        }

        $this->roles[$rrid] = $label;
        return $this;
    }
public function addRole ( $ rrid , $ label ) { if ( ! is_integer ( $ rrid ) ) { throw new \ InvalidArgumentException ( "The relative role identifier must be an integer." ) ; } if ( isset ( $ this -> roles [ $ rrid ] ) ) { throw new \ LogicException ( sprintf ( "This relative role identifier is already used (%d)." , $ rrid ) ) ; } $ this -> roles [ $ rrid ] = $ label ; return $ this ; }
Add a relative role.

@param integer $rrid
The relative role identifier.
@param mixed $label
The relative role label.

@throws InvalidArgumentException if the provided role identifier is not an integer.
@throws LogicException if the provided role identifier is already used.

@return RolesCollectionEvent
Add a relative role .