APIv4 - Improve row_count to work with HAVING, GROUP BY, and SELECT
authorColeman Watts <coleman@civicrm.org>
Fri, 26 Jun 2020 06:22:27 +0000 (02:22 -0400)
committerColeman Watts <coleman@civicrm.org>
Sun, 28 Jun 2020 18:13:18 +0000 (14:13 -0400)
commit651c4c95b6f8f52d8d6feeeafcf41dd7e915956f
tree07a5061be7658b1a6496ec1dcb20bc2cf4d726da
parent88409aaf90991f2a88e26585738c62a32c9e1705
APIv4 - Improve row_count to work with HAVING, GROUP BY, and SELECT

This changes the meaning of $result->count(), to give a total count of filtered items, ignoring limit and offset.
For DAO queries, you must select 'row_count' to trigger this behavior, as it requires a seperate query.
16 files changed:
CRM/Api4/Page/AJAX.php
Civi/Api4/Action/Domain/Get.php
Civi/Api4/Generic/BasicGetAction.php
Civi/Api4/Generic/BasicGetFieldsAction.php
Civi/Api4/Generic/DAOGetAction.php
Civi/Api4/Generic/Result.php
Civi/Api4/Generic/Traits/ArrayQueryActionTrait.php
Civi/Api4/Query/Api4SelectQuery.php
ang/api4Explorer/Explorer.html
ang/api4Explorer/Explorer.js
tests/phpunit/api/v4/Action/BasicActionsTest.php
tests/phpunit/api/v4/Action/ComplexQueryTest.php
tests/phpunit/api/v4/Action/ContactGetTest.php
tests/phpunit/api/v4/Action/GetFromArrayTest.php
tests/phpunit/api/v4/Query/Api4SelectQueryTest.php
tests/phpunit/api/v4/Query/OptionValueJoinTest.php