protected static $category = self::CATEGORY_AGGREGATE;
- protected static $params = [
- [
- 'prefix' => ['', 'DISTINCT', 'ALL'],
- 'max_expr' => 1,
- 'must_be' => ['SqlField', 'SqlWild'],
- 'cant_be' => [],
- ],
- ];
+ protected static $dataType = 'Integer';
- /**
- * Reformat result as integer
- *
- * @see \Civi\Api4\Utils\FormattingUtil::formatOutputValues
- * @param string $value
- * @param string $dataType
- * @return string|array
- */
- public function formatOutputValue($value, &$dataType) {
- // Count is always an integer
- $dataType = 'Integer';
- return (int) $value;
+ protected static function params(): array {
+ return [
+ [
+ 'flag_before' => ['DISTINCT' => ts('Distinct')],
+ 'max_expr' => 1,
+ 'must_be' => ['SqlField', 'SqlWild'],
+ ],
+ ];
}
/**
return ts('Count');
}
+ /**
+ * @return string
+ */
+ public static function getDescription(): string {
+ return ts('The number of items in the grouping.');
+ }
+
}