You are here

public static function SupportedEntities::alterEntityInfo in CiviCRM Entity 8.3

Allow extensions to alter entities.

Parameters

array $civicrm_entity_info: Supported civicrm_entity info.

Return value

mixed Altered civicrm_entity entity info.

1 call to SupportedEntities::alterEntityInfo()
SupportedEntities::getInfo in src/SupportedEntities.php
Gets information about the supported CiviCRM entities.

File

src/SupportedEntities.php, line 859

Class

SupportedEntities
Defines supported entities.

Namespace

Drupal\civicrm_entity

Code

public static function alterEntityInfo(&$civicrm_entity_info) {
  \Drupal::service('civicrm_entity.api')
    ->civicrmInitialize();
  $code_version = explode('.', \CRM_Utils_System::version());
  if (version_compare($code_version[0] . '.' . $code_version[1], 4.5) >= 0) {
    return \CRM_Utils_Hook::singleton()
      ->invoke([
      'civicrm_entity_info',
    ], $civicrm_entity_info, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, 'civicrm_alter_drupal_entities');
  }
  else {
    return \CRM_Utils_Hook::singleton()
      ->invoke(1, $civicrm_entity_info, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, \CRM_Core_DAO::$_nullObject, 'civicrm_alter_drupal_entities');
  }
}