+--------------------------------------------------------------------+
*/
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
- */
-
-
namespace Civi\Api4\Generic;
+use Civi\Api4\Utils\CoreUtil;
+
/**
* Base class for all actions that need to fetch records (`Get`, `Update`, `Delete`, etc.).
*
* @throws \API_Exception
*/
public function addWhere(string $fieldName, string $op, $value = NULL) {
- if (!in_array($op, \CRM_Core_DAO::acceptedSQLOperators())) {
+ if (!in_array($op, CoreUtil::getOperators())) {
throw new \API_Exception('Unsupported operator');
}
$this->where[] = [$fieldName, $op, $value];
}
return $output . '(' . $this->whereClauseToString($whereClause, $op) . ')';
}
- elseif (isset($whereClause[1]) && in_array($whereClause[1], \CRM_Core_DAO::acceptedSQLOperators())) {
+ elseif (isset($whereClause[1]) && in_array($whereClause[1], CoreUtil::getOperators())) {
$output = $whereClause[0] . ' ' . $whereClause[1] . ' ';
if (isset($whereClause[2])) {
$output .= is_array($whereClause[2]) ? '[' . implode(', ', $whereClause[2]) . ']' : $whereClause[2];