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) . ')';
}