* Get a list of managed activity-types by searching CiviCase XML files.
*
* @param \CRM_Case_XMLRepository $xmlRepo
- * @param \CRM_Core_ManagedEntities $me
*
* @return array
* @see CRM_Utils_Hook::managed
*/
- public static function createManagedActivityTypes(CRM_Case_XMLRepository $xmlRepo, CRM_Core_ManagedEntities $me) {
+ public static function createManagedActivityTypes(CRM_Case_XMLRepository $xmlRepo): array {
$result = [];
$validActTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name');
* Get a list of managed relationship-types by searching CiviCase XML files.
*
* @param \CRM_Case_XMLRepository $xmlRepo
- * @param \CRM_Core_ManagedEntities $me
*
* @return array
* @see CRM_Utils_Hook::managed
*/
- public static function createManagedRelationshipTypes(CRM_Case_XMLRepository $xmlRepo, CRM_Core_ManagedEntities $me) {
+ public static function createManagedRelationshipTypes(CRM_Case_XMLRepository $xmlRepo): array {
$result = [];
if (!isset(Civi::$statics[__CLASS__]['reltypes'])) {
* Implements hook_civicrm_managed().
*/
function civi_case_civicrm_managed(&$entities, $modules) {
- // Don't optimize for $modules because the below functions delegate to other extensions
- $entities = array_merge($entities,
- 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())
- );
+ // Don't optimize for $modules because `createManagedCaseTypes` delegates to other extensions
+ $entities = array_merge($entities, CRM_Case_ManagedEntities::createManagedCaseTypes());
+ // These functions always declare module = civicrm
+ if (!$modules || in_array('civicrm', $modules, TRUE)) {
+ $entities = array_merge($entities,
+ CRM_Case_ManagedEntities::createManagedActivityTypes(CRM_Case_XMLRepository::singleton()),
+ CRM_Case_ManagedEntities::createManagedRelationshipTypes(CRM_Case_XMLRepository::singleton())
+ );
+ }
}