Art4\JsonApiClient\Utils\DataContainer::set PHP Method

set() public method

Set a value
public set ( string $key, mixed $value ) : self
$key string The Key
$value mixed The Value
return self
    public function set($key, $value)
    {
        // Allow non-associative array for collections
        if ($key === '') {
            $this->data[] = $value;
        } else {
            $this->data[$key] = $value;
        }
        return $this;
    }