Overview
----------------------------------------
The CustomGroups are used to generate virtual entities (if they set `is_multiple`). Toggling `is_multiple`
should cause the virtual entity to be added or removed.
Reproduction steps
----------------------------------------
1. Create a custom data group. Leave default `is_multiple=0`.
2. View "API Explorer". Look for the virtual entity. (It's not there. Properly so.)
3. Edit custom data group. Change to `is_multiple=1`.
4. Reload "API Explorer". Look for the virtual entity.
Before
----------------------------------------
The entity does not appear. You have to do a system-flush.
After
----------------------------------------
The entity does appear.
/**
* Business object for managing custom data groups.
*/
-class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup {
+class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup implements \Civi\Core\HookInterface {
+
+ /**
+ * @param \Civi\Core\Event\PostEvent $e
+ * @see CRM_Utils_Hook::post()
+ */
+ public static function self_hook_civicrm_post(\Civi\Core\Event\PostEvent $e): void {
+ Civi::cache('metadata')->flush();
+ }
/**
* Takes an associative array and creates a custom group object.