From: colemanw Date: Fri, 1 Sep 2023 20:08:27 +0000 (-0400) Subject: Managed - Move component managed entity declarations to component extensions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=721afe43f60fa1b03fa851e0bfeddaf9da2148ef;p=civicrm-core.git Managed - Move component managed entity declarations to component extensions CRM_Core_Component_Info had a quasi-listener for adding managed entities; it was only used by CiviCase. This moves it to a real listener in the civi_case extension. --- diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index 5269af7a2d..bd4037ceff 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -51,20 +51,6 @@ class CRM_Case_Info extends CRM_Core_Component_Info { return $result; } - /** - * @inheritDoc - * @return array - * @throws CRM_Core_Exception - */ - public function getManagedEntities() { - $entities = array_merge( - CRM_Case_ManagedEntities::createManagedCaseTypes(), - CRM_Case_ManagedEntities::createManagedActivityTypes(CRM_Case_XMLRepository::singleton(), CRM_Core_ManagedEntities::singleton()), - CRM_Case_ManagedEntities::createManagedRelationshipTypes(CRM_Case_XMLRepository::singleton(), CRM_Core_ManagedEntities::singleton()) - ); - return $entities; - } - /** * @inheritDoc * @param bool $getAllUnconditionally diff --git a/CRM/Core/Component/Info.php b/CRM/Core/Component/Info.php index 640f3e26d2..037b3cea0e 100644 --- a/CRM/Core/Component/Info.php +++ b/CRM/Core/Component/Info.php @@ -139,17 +139,6 @@ abstract class CRM_Core_Component_Info { */ abstract public function getInfo(); - /** - * Get a list of entities to register via API. - * - * @return array - * list of entities; same format as CRM_Utils_Hook::managedEntities(&$entities) - * @see CRM_Utils_Hook::managedEntities - */ - public function getManagedEntities() { - return []; - } - /** * Provides permissions that are unwise for Anonymous Roles to have. * diff --git a/CRM/Core/ManagedEntities.php b/CRM/Core/ManagedEntities.php index 52e8d1c0c4..dc67cfdb21 100644 --- a/CRM/Core/ManagedEntities.php +++ b/CRM/Core/ManagedEntities.php @@ -523,12 +523,6 @@ class CRM_Core_ManagedEntities { */ protected function getDeclarations($modules = NULL): array { $declarations = []; - // Exclude components if given a module name. - if (!$modules || $modules === ['civicrm']) { - foreach (CRM_Core_Component::getEnabledComponents() as $component) { - $declarations = array_merge($declarations, $component->getManagedEntities()); - } - } CRM_Utils_Hook::managed($declarations, $modules); $this->validate($declarations); foreach (array_keys($declarations) as $name) { diff --git a/ext/civi_case/civi_case.php b/ext/civi_case/civi_case.php index 444ef886e7..82665f72e3 100644 --- a/ext/civi_case/civi_case.php +++ b/ext/civi_case/civi_case.php @@ -1,3 +1,16 @@