protected static function params(): array {
return [
[
- 'min_expr' => 3,
- 'max_expr' => 3,
'optional' => FALSE,
+ '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'),
],
];
}
* @return string
*/
public static function getTitle(): string {
- return ts('If');
+ return ts('If/Else');
+ }
+
+ /**
+ * @return string
+ */
+ public static function getDescription(): string {
+ return ts('If the field is empty, the first value, otherwise the second.');
}
}