Elastica\Param::setParam PHP Method

setParam() public method

Sets (overwrites) the value at the given key.
public setParam ( string $key, mixed $value )
$key string Key to set
$value mixed Key Value
    public function setParam($key, $value)
    {
        $this->_params[$key] = $value;
        return $this;
    }

Usage Example

 public function testHasParam()
 {
     $param = new Param();
     $key = 'name';
     $value = 'nicolas ruflin';
     $this->assertFalse($param->hasParam($key));
     $param->setParam($key, $value);
     $this->assertTrue($param->hasParam($key));
 }