}
/**
- * Escape an identifier (table or field name) optional with a schema like (schema.)table
+ * Escape an identifier (table or field name) optional with a schema like ((schema.)table.)field
*
- * @param $identifier Table, field name
+ * @param string $identifier Table, field name
* @return string Quotes table or field name
*/
public static function quoteIdentifier(string $identifier): string
array_walk($fields, function(&$value, $key) use ($options)
{
$field = $value;
- $value = '`' . str_replace('`', '``', $value) . '`';
+ $value = DBA::quoteIdentifier($field);
if (!empty($options['group_by']) && !in_array($field, $options['group_by'])) {
$value = 'ANY_VALUE(' . $value . ') AS ' . $value;