function changeFtsMapping($ftscfg, $mapping, $action, $dictname = null)
{
if (count($mapping) > 0) {
$f_schema = $this->_schema;
$this->fieldClean($f_schema);
$this->fieldClean($ftscfg);
$this->fieldClean($dictname);
$this->arrayClean($mapping);
switch ($action) {
case 'alter':
$whatToDo = "ALTER";
break;
case 'drop':
$whatToDo = "DROP";
break;
default:
$whatToDo = "ADD";
break;
}
$sql = "ALTER TEXT SEARCH CONFIGURATION \"{$f_schema}\".\"{$ftscfg}\" {$whatToDo} MAPPING FOR ";
$sql .= implode(",", $mapping);
if ($action != 'drop' && !empty($dictname)) {
$sql .= " WITH {$dictname}";
}
return $this->execute($sql);
} else {
return -1;
}
}