You are here

function civicrm_entity_get_supported_entity_info in CiviCRM Entity 7.2

Get supported CiviCRM entity information

implement hook_civicrm_entity_supported_info() to get you custom CiviCRM API entity supported

Parameters

null $entity_type:

Return value

array|void

7 calls to civicrm_entity_get_supported_entity_info()
civicrm_entity_ds_fields_info in ./civicrm_entity.module
Implements hook_ds_fields_info().
civicrm_entity_op_access in ./civicrm_entity.module
Granular per-entity CRUD access control
civicrm_entity_theme in ./civicrm_entity.module
Implements hook_theme().
civicrm_entity_uninstall in ./civicrm_entity.install
Implements hook_uninstall()
civicrm_entity_views_data_alter in ./civicrm_entity.module
Implements hook_views_data_alter().

... See full list

File

./civicrm_entity.module, line 485

Code

function civicrm_entity_get_supported_entity_info($entity_type = NULL) {
  $civicrm_entity_info = civicrm_entity_supported_entities_info();
  if (civicrm_initialize()) {
    $codeVersion = explode('.', CRM_Utils_System::version());

    // if db.ver < code.ver, time to upgrade
    if (version_compare($codeVersion[0] . '.' . $codeVersion[1], 5.28) >= 0) {
      CRM_Utils_Hook::singleton()
        ->invoke([
        '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_entity_supported_info');
    }
    elseif (version_compare($codeVersion[0] . '.' . $codeVersion[1], 4.5) >= 0) {
      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, CRM_Core_DAO::$_nullObject, 'civicrm_entity_supported_info');
    }
    else {
      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_entity_supported_info');
    }
  }
  if (empty($entity_type)) {
    return $civicrm_entity_info;
  }
  elseif (isset($civicrm_entity_info[$entity_type])) {
    return $civicrm_entity_info[$entity_type];
  }
}