Merge pull request #23352 from eileenmcnaughton/leg
[civicrm-core.git] / Civi / Api4 / Generic / AbstractQueryAction.php
index ed7ac9bf374d88e99bf4c2df09bee9c0b087d325..308c5dcc27062ed41ebf6f6438a1b482c11b34d3 100644 (file)
  +--------------------------------------------------------------------+
  */
 
-/**
- *
- * @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.).
  *
@@ -86,7 +81,7 @@ abstract class AbstractQueryAction extends AbstractAction {
    * @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];
@@ -145,7 +140,7 @@ abstract class AbstractQueryAction extends AbstractAction {
       }
       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];