protected function _buildInsertPart($parts, $query, $generator)
    {
        $table = $parts[0];
        $columns = $this->_stringifyExpressions($parts[1], $generator);
        $modifiers = $this->_buildModifierPart($query->clause('modifier'), $query, $generator);

        return sprintf(
            'INSERT%s INTO %s (%s) OUTPUT INSERTED.*',
            $modifiers,
            $table,
            implode(', ', $columns)
        );
    }
protected function _buildInsertPart($parts, $query, $generator)
    {
        $table = $parts[0];
        $columns = $this->_stringifyExpressions($parts[1], $generator);
        $modifiers = $this->_buildModifierPart($query->clause('modifier'), $query, $generator);

        return sprintf(
            'INSERT%s INTO %s (%s) OUTPUT INSERTED.*',
            $modifiers,
            $table,
            implode(', ', $columns)
        );
    }
protected function _buildInsertPart ( $ parts , $ query , $ generator ) { $ table = $ parts [ 0 ] ; $ columns = $ this -> _stringifyExpressions ( $ parts [ 1 ] , $ generator ) ; $ modifiers = $ this -> _buildModifierPart ( $ query -> clause ( 'modifier' ) , $ query , $ generator ) ; return sprintf ( 'INSERT%s INTO %s (%s) OUTPUT INSERTED.*' , $ modifiers , $ table , implode ( ', ' , $ columns ) ) ; }
Generates the INSERT part of a SQL query

To better handle concurrency and low transaction isolation levels,
we also include an OUTPUT clause so we can ensure we get the inserted
row's data back.

@param array $parts The parts to build
@param \Cake\Database\Query $query The query that is being compiled
@param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
@return string
Generates the INSERT part of a SQL query