Elastica\ResultSet::offsetSet PHP Method

offsetSet() public method

Offset to set.
public offsetSet ( integer $offset, Result $value )
$offset integer
$value Result
    public function offsetSet($offset, $value)
    {
        if (!$value instanceof Result) {
            throw new InvalidException('ResultSet is a collection of Result only.');
        }
        if (!isset($this->_results[$offset])) {
            throw new InvalidException('Offset does not exist.');
        }
        $this->_results[$offset] = $value;
    }