public function set($key, $value)
    {
        if ($key === null && is_object($value)) {
            $key = spl_object_hash($value);
        }

        $this->data[$key] = $value;

        return $this;
    }
public function set($key, $value)
    {
        if ($key === null && is_object($value)) {
            $key = spl_object_hash($value);
        }

        $this->data[$key] = $value;

        return $this;
    }
public function set ( $ key , $ value ) { if ( $ key === null && is_object ( $ value ) ) { $ key = spl_object_hash ( $ value ) ; } $ this -> data [ $ key ] = $ value ; return $ this ; }
Set a key value pair

@param string $key   Key to set
@param mixed  $value Value to set

@return GenericCollection Returns a reference to the object
Set a key value pair