public function setAttribute($key, $val)
    {
        if(is_null($val) && array_key_exists($key, $this->attributes))
            unset($this->attributes[$key]);
        else
            $this->attributes[$key] = $val;
    }
public function setAttribute($key, $val)
    {
        if(is_null($val) && array_key_exists($key, $this->attributes))
            unset($this->attributes[$key]);
        else
            $this->attributes[$key] = $val;
    }
public function setAttribute ( $ key , $ val ) { if ( is_null ( $ val ) && array_key_exists ( $ key , $ this -> attributes ) ) unset ( $ this -> attributes [ $ key ] ) ; else $ this -> attributes [ $ key ] = $ val ; }
Used to set attributes of the RequestContext

@param string $key The name of the attribute
@param mixed  $val The value for the attribute

@return void
Used to set attributes of the RequestContext