Merge pull request #23814 from civicrm/5.51
[civicrm-core.git] / Civi / Api4 / Query / SqlFunctionISNULL.php
index 7b614a53811148e891ea27440111fc2ccc4b3fec..17d729d430d675fbf879207006086c343ba1e2be 100644 (file)
@@ -18,11 +18,15 @@ class SqlFunctionISNULL extends SqlFunction {
 
   protected static $category = self::CATEGORY_COMPARISON;
 
-  protected static $params = [
-    [
-      'optional' => FALSE,
-    ],
-  ];
+  protected static $dataType = 'Boolean';
+
+  protected static function params(): array {
+    return [
+      [
+        'optional' => FALSE,
+      ],
+    ];
+  }
 
   /**
    * @return string
@@ -32,17 +36,10 @@ class SqlFunctionISNULL extends SqlFunction {
   }
 
   /**
-   * Reformat result as boolean
-   *
-   * @see \Civi\Api4\Utils\FormattingUtil::formatOutputValues
-   * @param string $value
-   * @param string $dataType
-   * @return string|array
+   * @return string
    */
-  public function formatOutputValue($value, &$dataType) {
-    // Value is always TRUE or FALSE
-    $dataType = 'Boolean';
-    return $value;
+  public static function getDescription(): string {
+    return ts('TRUE if the value is NULL, otherwise FALSE.');
   }
 
 }