Merge branch '5.52'
[civicrm-core.git] / Civi / Api4 / Query / SqlFunctionIF.php
index 24e2faa65a8b7d1be7e637dd90325b96fe4433a4..810cfe2d70f0253894da47341d1500159ab43e7f 100644 (file)
@@ -23,14 +23,19 @@ class SqlFunctionIF extends SqlFunction {
   protected static function params(): array {
     return [
       [
-        'min_expr' => 3,
-        'max_expr' => 3,
         'optional' => FALSE,
-        'ui_defaults' => [
-          ['type' => 'SqlField', 'placeholder' => ts('If')],
-          ['type' => 'SqlField', 'placeholder' => ts('Then')],
-          ['type' => 'SqlField', 'placeholder' => ts('Else')],
-        ],
+        'must_be' => ['SqlEquation', 'SqlField'],
+        'label' => ts('If'),
+      ],
+      [
+        'optional' => FALSE,
+        'must_be' => ['SqlField', 'SqlString', 'SqlNumber', 'SqlNull'],
+        'label' => ts('Then'),
+      ],
+      [
+        'optional' => FALSE,
+        'must_be' => ['SqlField', 'SqlString', 'SqlNumber', 'SqlNull'],
+        'label' => ts('Else'),
       ],
     ];
   }