protected function buildInsert($table, array $row, $options = []) {
        if (self::val(Db::OPTION_UPSERT, $options)) {
            return $this->buildUpsert($table, $row, $options);
        } elseif (self::val(Db::OPTION_IGNORE, $options)) {
            $sql = 'insert ignore ';
        } elseif (self::val(Db::OPTION_REPLACE, $options)) {
            $sql = 'replace ';
        } else {
            $sql = 'insert ';
        }
        $sql .= $this->prefixTable($table);

        // Add the list of values.
        $sql .=
            "\n".$this->bracketList(array_keys($row), '`').
            "\nvalues".$this->bracketList($row, "'");

        return $sql;
    }
protected function buildInsert($table, array $row, $options = []) {
        if (self::val(Db::OPTION_UPSERT, $options)) {
            return $this->buildUpsert($table, $row, $options);
        } elseif (self::val(Db::OPTION_IGNORE, $options)) {
            $sql = 'insert ignore ';
        } elseif (self::val(Db::OPTION_REPLACE, $options)) {
            $sql = 'replace ';
        } else {
            $sql = 'insert ';
        }
        $sql .= $this->prefixTable($table);

        // Add the list of values.
        $sql .=
            "\n".$this->bracketList(array_keys($row), '`').
            "\nvalues".$this->bracketList($row, "'");

        return $sql;
    }
protected function buildInsert ( $ table , array $ row , $ options = [ ] ) { if ( self :: val ( Db :: OPTION_UPSERT , $ options ) ) { return $ this -> buildUpsert ( $ table , $ row , $ options ) ; } elseif ( self :: val ( Db :: OPTION_IGNORE , $ options ) ) { $ sql = 'insert ignore ' ; } elseif ( self :: val ( Db :: OPTION_REPLACE , $ options ) ) { $ sql = 'replace ' ; } else { $ sql = 'insert ' ; } $ sql .= $ this -> prefixTable ( $ table ) ; // Add the list of values. $ sql .= "\n" . $ this -> bracketList ( array_keys ( $ row ) , '`' ) . "\nvalues" . $ this -> bracketList ( $ row , "'" ) ; return $ sql ; }
Build an insert statement.

@param string|Identifier $table The name of the table to insert to.
@param array $row The row to insert.
@param array $options An array of options for the insert. See {@link Db::insert} for the options.
@return string Returns the the sql string of the insert statement.
Build an insert statement .