Api4: add calculated field `contact_count` to Group
authorAidan Saunders <aidan.saunders@squiffle.uk>
Tue, 23 May 2023 21:13:11 +0000 (22:13 +0100)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Tue, 23 May 2023 22:06:59 +0000 (23:06 +0100)
commit5b475522168219a7d7bfaaa5ed4e206058e30e60
treec56fc660f64143a19a2898ee1c5af7bface5022a
parent6924a00d3abd5adf7d0d78f2535e2f8e2d2226c7
Api4: add calculated field `contact_count` to Group

This provides the current count of 'added' group members and smart group
members.
Note this does not rebuild the group cache so smart group counts may be
out of date or zero.

See https://stackoverflow.com/questions/47918929/coalesce-for-zero-instead-of-null/47919047#47919047
for the COALESCE(NULLIF()) construct.
Civi/Api4/Service/Spec/Provider/GroupGetSpecProvider.php [new file with mode: 0644]