3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
12 namespace Civi\Api4\Query
;
17 class SqlFunctionGROUP_CONCAT
extends SqlFunction
{
19 public $supportsExpansion = TRUE;
21 protected static $category = self
::CATEGORY_AGGREGATE
;
23 protected static $params = [
25 'prefix' => ['', 'DISTINCT', 'ALL'],
27 'must_be' => ['SqlField'],
31 'prefix' => ['ORDER BY'],
33 'suffix' => ['', 'ASC', 'DESC'],
34 'must_be' => ['SqlField'],
38 'prefix' => ['SEPARATOR'],
40 'must_be' => ['SqlString'],
42 // @see self::formatOutput()
44 'expr' => ['"' . \CRM_Core_DAO
::VALUE_SEPARATOR
. '"'],
50 * Reformat result as array if using default separator
52 * @see \Civi\Api4\Utils\FormattingUtil::formatOutputValues
53 * @param string $value
54 * @return string|array
56 public function formatOutputValue($value) {
57 $exprArgs = $this->getArgs();
58 if (!$exprArgs[2]['prefix']) {
59 $value = explode(\CRM_Core_DAO
::VALUE_SEPARATOR
, $value);
67 public static function getTitle(): string {