public function set($key, $value = null)
    {
        $key = $this->resolveAlias($key);

        $mutator = 'set' . $this->toCamelCase($key) . 'Value';

        if (is_callable([$this, $mutator])) {
            $this->$mutator($value);
        } else {
            $this->data[$key] = $value;
        }

        return $this;
    }
public function set($key, $value = null)
    {
        $key = $this->resolveAlias($key);

        $mutator = 'set' . $this->toCamelCase($key) . 'Value';

        if (is_callable([$this, $mutator])) {
            $this->$mutator($value);
        } else {
            $this->data[$key] = $value;
        }

        return $this;
    }
public function set ( $ key , $ value = null ) { $ key = $ this -> resolveAlias ( $ key ) ; $ mutator = 'set' . $ this -> toCamelCase ( $ key ) . 'Value' ; if ( is_callable ( [ $ this , $ mutator ] ) ) { $ this -> $ mutator ( $ value ) ; } else { $ this -> data [ $ key ] = $ value ; } return $ this ; }
Magic setter to set a table field.

@param   string $key   The key name.
@param   mixed  $value The value to set.

@return  static

@since   2.0
@throws  \InvalidArgumentException
Magic setter to set a table field .