yii\sphinx\QueryBuilder::generateInsertReplace PHP Метод

generateInsertReplace() защищенный Метод

Generates INSERT/REPLACE SQL statement.
protected generateInsertReplace ( string $statement, string $index, array $columns, array &$params ) : string
$statement string statement ot be generated.
$index string the affected index name.
$columns array the column data (name => value).
$params array the binding parameters that will be generated by this method.
Результат string generated SQL
    protected function generateInsertReplace($statement, $index, $columns, &$params)
    {
        if (($indexSchema = $this->db->getIndexSchema($index)) !== null) {
            $indexSchemas = [$indexSchema];
        } else {
            $indexSchemas = [];
        }
        $names = [];
        $placeholders = [];
        foreach ($columns as $name => $value) {
            if ($value === null) {
                // Sphinx does not allows inserting `null`, column should be skipped instead
                continue;
            }
            $names[] = $this->db->quoteColumnName($name);
            $placeholders[] = $this->composeColumnValue($indexSchemas, $name, $value, $params);
        }
        return $statement . ' INTO ' . $this->db->quoteIndexName($index) . ' (' . implode(', ', $names) . ') VALUES (' . implode(', ', $placeholders) . ')';
    }