public function set($fields = null)
    {
        if ($fields === null) {
            return $this->clause('set');
        }

        if (!in_array($this->action(), [self::ACTION_CREATE, self::ACTION_UPDATE])) {
            throw new \UnexpectedValueException(__('The action of this query needs to be either create update'));
        }

        $this->_parts['set'] = $fields;

        return $this;
    }
public function set($fields = null)
    {
        if ($fields === null) {
            return $this->clause('set');
        }

        if (!in_array($this->action(), [self::ACTION_CREATE, self::ACTION_UPDATE])) {
            throw new \UnexpectedValueException(__('The action of this query needs to be either create update'));
        }

        $this->_parts['set'] = $fields;

        return $this;
    }
public function set ( $ fields = null ) { if ( $ fields === null ) { return $ this -> clause ( 'set' ) ; } if ( ! in_array ( $ this -> action ( ) , [ self :: ACTION_CREATE , self :: ACTION_UPDATE ] ) ) { throw new \ UnexpectedValueException ( __ ( 'The action of this query needs to be either create update' ) ) ; } $ this -> _parts [ 'set' ] = $ fields ; return $ this ; }
Set fields to save in resources

@param array|null $fields The field to set
@return $this|array
Set fields to save in resources