You are here

public static function CRM_Utils_Type::mysqlOrderByFieldFunctionCallback in CiviCRM Entity 8.3

Preg_replace_callback for mysqlOrderByFieldFunction escape.

Add backticks around the field name.

Parameters

string $clause:

Return value

string

1 call to CRM_Utils_Type::mysqlOrderByFieldFunctionCallback()
CRM_Utils_Type::escape in tests/src/Type.php
Verify that a variable is of a given type, and apply a bit of processing.

File

tests/src/Type.php, line 498

Class

CRM_Utils_Type
@package CRM @copyright CiviCRM LLC (c) 2004-2017

Code

public static function mysqlOrderByFieldFunctionCallback($clause) {
  return preg_replace('/field\\((\\w*)/', 'field(`${1}`', $clause);
}