public function set($field, $value = null)
    {
        if ($field === null) {
            throw new \InvalidArgumentException('Cannot access empty property');
        }

        $this->$field = $value;

        return $this;
    }
public function set($field, $value = null)
    {
        if ($field === null) {
            throw new \InvalidArgumentException('Cannot access empty property');
        }

        $this->$field = $value;

        return $this;
    }
public function set ( $ field , $ value = null ) { if ( $ field === null ) { throw new \ InvalidArgumentException ( 'Cannot access empty property' ) ; } $ this -> $ field = $ value ; return $ this ; }
Set value to Data object.

@param string $field The field to set.
@param mixed  $value The value to set.

@note  If you get "Cannot access property started with '\0'" error message, means you should not
use (array) to convert object to array. This action will make protected property contains in array
and start with \0 of property name. Use `get_object_vars()` instead.

@throws  \InvalidArgumentException
@return  static Return self to support chaining.
Set value to Data object .