X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FApi4%2FQuery%2FSqlFunction.php;h=dbc245f7bfc40dfd5e3ed0c5e6dbc74a47614b75;hb=e6ac8b253e7c321dc2f5ced965de48b616c20275;hp=19753d91acfa4f73e5b15b10d68a8e5eb073aeca;hpb=dfbf151818668f98a0cdfe583a5d629f5cc8bb2b;p=civicrm-core.git diff --git a/Civi/Api4/Query/SqlFunction.php b/Civi/Api4/Query/SqlFunction.php index 19753d91ac..dbc245f7bf 100644 --- a/Civi/Api4/Query/SqlFunction.php +++ b/Civi/Api4/Query/SqlFunction.php @@ -22,6 +22,19 @@ abstract class SqlFunction extends SqlExpression { protected $args = []; + /** + * Used for categorizing functions in the UI + * + * @var string + */ + protected static $category; + + const CATEGORY_AGGREGATE = 'aggregate', + CATEGORY_COMPARISON = 'comparison', + CATEGORY_DATE = 'date', + CATEGORY_MATH = 'math', + CATEGORY_STRING = 'string'; + /** * Parse the argument string into an array of function arguments */ @@ -186,4 +199,16 @@ abstract class SqlFunction extends SqlExpression { return $params; } + /** + * @return string + */ + public static function getCategory(): string { + return static::$category; + } + + /** + * @return string + */ + abstract public static function getTitle(): string; + }