APIv4 Search: Improve GROUP_CONCAT with :label prefix
authorColeman Watts <coleman@civicrm.org>
Wed, 23 Sep 2020 18:35:40 +0000 (14:35 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 24 Sep 2020 12:14:12 +0000 (08:14 -0400)
commit7ce7b1cdc4bda5f519ec6d321b7e57fe1150934f
tree1e250013057b8ab6f4f7bc76e96029ae5d42afb1
parent0cc2ab3ab85f5ac5ec837c5b5d42c5c135a73a80
APIv4 Search: Improve GROUP_CONCAT with :label prefix

This moves handing of pseudoconstant suffix replacement from the UI level to the API level,
which allows APIv4 to return GROUP_CONCAT results as an array (by default, if no separator specified).

It also improves post-query formatting in general, with finer-grained formating callbacks for sql functions.
16 files changed:
Civi/Api4/Query/Api4SelectQuery.php
Civi/Api4/Query/SqlExpression.php
Civi/Api4/Query/SqlField.php
Civi/Api4/Query/SqlFunction.php
Civi/Api4/Query/SqlFunctionCOUNT.php
Civi/Api4/Query/SqlFunctionGREATEST.php
Civi/Api4/Query/SqlFunctionGROUP_CONCAT.php
Civi/Api4/Query/SqlFunctionLEAST.php
Civi/Api4/Query/SqlFunctionMAX.php
Civi/Api4/Query/SqlFunctionMIN.php
Civi/Api4/Query/SqlFunctionNULLIF.php
Civi/Api4/Utils/FormattingUtil.php
ext/search/ang/search/crmSearch.component.js
ext/search/ang/search/crmSearchFunction.component.js
tests/phpunit/api/v4/Action/SqlFunctionTest.php
tests/phpunit/api/v4/Query/SqlExpressionParserTest.php