public function setRole($role_id)
    {
        if (!empty($role_id) && $this->policy === Rule::NOINHERIT)
            throw new Exception("Rule::NOINHERIT can not be used in combination with a role");

        if ($role_id instanceof Role)
        {
            $this->role = $role_id;
            $role_id = $role_id->getID();
        }
        elseif (!is_scalar($role_id))
            throw new Exception("Role-ID must be a Role or a scalar");

        if ($role_id !== $this->role_id)
        {
            $this->changed = true;
            $this->role_id = $role_id;
        }
    }
public function setRole($role_id)
    {
        if (!empty($role_id) && $this->policy === Rule::NOINHERIT)
            throw new Exception("Rule::NOINHERIT can not be used in combination with a role");

        if ($role_id instanceof Role)
        {
            $this->role = $role_id;
            $role_id = $role_id->getID();
        }
        elseif (!is_scalar($role_id))
            throw new Exception("Role-ID must be a Role or a scalar");

        if ($role_id !== $this->role_id)
        {
            $this->changed = true;
            $this->role_id = $role_id;
        }
    }
public function setRole ( $ role_id ) { if ( ! empty ( $ role_id ) && $ this -> policy === Rule :: NOINHERIT ) throw new Exception ( "Rule::NOINHERIT can not be used in combination with a role" ) ; if ( $ role_id instanceof Role ) { $ this -> role = $ role_id ; $ role_id = $ role_id -> getID ( ) ; } elseif ( ! is_scalar ( $ role_id ) ) throw new Exception ( "Role-ID must be a Role or a scalar" ) ; if ( $ role_id !== $ this -> role_id ) { $ this -> changed = true ; $ this -> role_id = $ role_id ; } }
Set the role this Rule applies to.

@param scala|Role $role_id Either a Role object or a Role-ID
@throws Wedeto\ACL\Exception When the role is not a Role object or a scalar
Set the role this Rule applies to .