ManagedEntity - Add update mode 'unmodified' and fix cleanup mode 'unused' for APIv4
authorColeman Watts <coleman@civicrm.org>
Sun, 7 Nov 2021 16:54:54 +0000 (11:54 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 10 Nov 2021 22:05:19 +0000 (17:05 -0500)
commit095e8ae41f6c71a8c7372828046fc012545b85a6
treed3e6093bc85889206937e27a4b80a19a3f845886
parent04309075f0d3aec4cd85f5a2e26262d1510ecc37
ManagedEntity - Add update mode 'unmodified' and fix cleanup mode 'unused' for APIv4

Update mode 'unmodified' will only update a record if it has not been locally edited.
This new setting works only for entities opted-in to the APIv4 ManagedEntity trait, and will
emit a warning and fall back on 'always' for others.

Cleanup mode 'unmodified' now works for APIv4 managed entities, and they are cleaned up
in reverse order to ensure references are deleted before their parents.
CRM/Core/ManagedEntities.php
ext/search_kit/tests/phpunit/api/v4/SearchDisplay/ManagedSearchTest.php [new file with mode: 0644]
ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchAfformTest.php
tests/phpunit/api/v4/Entity/ManagedEntityTest.php