X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FApi4%2FQuery%2FSqlFunctionCOALESCE.php;h=5264e04ef1432beeb220bed94daf4db6860eab86;hb=2929fd34b84a1b3d5ebbba8855f01b9f73363dd0;hp=584f4374ec774015b594668f842a123e08563e2b;hpb=9d7ed4997d5cd872593bbfa1b7c6f5aff7ceae47;p=civicrm-core.git diff --git a/Civi/Api4/Query/SqlFunctionCOALESCE.php b/Civi/Api4/Query/SqlFunctionCOALESCE.php index 584f4374ec..5264e04ef1 100644 --- a/Civi/Api4/Query/SqlFunctionCOALESCE.php +++ b/Civi/Api4/Query/SqlFunctionCOALESCE.php @@ -18,12 +18,20 @@ class SqlFunctionCOALESCE extends SqlFunction { protected static $category = self::CATEGORY_COMPARISON; - protected static $params = [ - [ - 'expr' => 99, - 'optional' => FALSE, - ], - ]; + protected static $dataType = 'String'; + + protected static function params(): array { + return [ + [ + 'max_expr' => 99, + 'optional' => FALSE, + 'ui_defaults' => [ + ['type' => 'SqlField', 'placeholder' => ts('If')], + ['type' => 'SqlField', 'placeholder' => ts('Else')], + ], + ], + ]; + } /** * @return string @@ -32,4 +40,11 @@ class SqlFunctionCOALESCE extends SqlFunction { return ts('Coalesce'); } + /** + * @return string + */ + public static function getDescription(): string { + return ts('The first value that is not null.'); + } + }