Using CRM_Utils_Array::first.
authorJohan Vervloet <johanv@johanv.org>
Wed, 11 Mar 2015 09:17:52 +0000 (10:17 +0100)
committereileenmcnaugton <eileen@fuzion.co.nz>
Wed, 12 Aug 2015 23:39:35 +0000 (11:39 +1200)
api/v3/utils.php

index dd01e86104a0a31fc75767a1277ced5aa708c580..bdb6102f58d3708bda6877f98cbdfa4b69436322 100644 (file)
@@ -530,8 +530,7 @@ function _civicrm_api3_get_using_query_object_simple($dao_name, $params, $return
     else {
       // We expect only one element in the array, of the form
       // "operator" => "rhs".
-      $dummy = array_keys($value);
-      $operator = $dummy[0];
+      $operator = CRM_Utils_Array::first(array_keys($value));
       if (!in_array($operator, CRM_Core_DAO::acceptedSQLOperators())) {
         // if operator not found, use = as default.
         $operator = "=";