You are here

function _civicrm_entity_enabled_entities in CiviCRM Entity 7

Same name and namespace in other branches
  1. 7.2 civicrm_entity.module \_civicrm_entity_enabled_entities()

Whitelist of enabled entities. We don't have a compelling reason for not including all entities but some entities are fairly non-standard and of course the rule hook would instantiate rules more often if all were enabled.

The whitelist approach is mostly out of caution

Return value

array of enabled entities keyed by the drupal entity name

6 calls to _civicrm_entity_enabled_entities()
civicrm_entity_civicrm_post in ./civicrm_entity.module
Implement the post hook and fire the corresponding rules event.
civicrm_entity_entity_info in ./civicrm_entity.module
Here we declare selected CiviCRM entities to Drupal.
civicrm_entity_entity_property_info_alter in ./civicrm_entity.module
Here we declare Selected CiviCRM entities fields to Drupal.
civicrm_entity_rules_data_info in ./civicrm_entity.rules.inc
Implements of hook_rules_data_type_info().
civicrm_entity_rules_event_info in ./civicrm_entity.rules.inc
Implements hook_rules_event_info().

... See full list

2 string references to '_civicrm_entity_enabled_entities'
civicrm_entity_rules_action_info in ./civicrm_entity.rules.inc
Implements hook_rules_action_info().
civicrm_entity_rules_condition_info in ./civicrm_entity.rules.inc
Implements hook_rules_condition_info().

File

./civicrm_entity.module, line 293
Implement CiviCRM entities as a Drupal Entity.

Code

function _civicrm_entity_enabled_entities() {
  $whitelist = array(
    'civicrm_address' => 'address',
    'civicrm_event' => 'event',
    'civicrm_contact' => 'contact',
    'civicrm_contribution' => 'contribution',
    'civicrm_participant' => 'participant',
    'civicrm_relationship' => 'relationship',
    'civicrm_relationship_type' => 'relationship_type',
    'civicrm_activity' => 'activity',
    'civicrm_entity_tag' => 'entity_tag',
    'civicrm_membership' => 'membership',
    'civicrm_membership_type' => 'membership_type',
    'civicrm_group' => 'group',
    'civicrm_grant' => 'grant',
    'civicrm_tag' => 'tag',
  );

  //dirty check for whether financialType exists
  if (!method_exists('CRM_Contribute_PseudoConstant', 'contributionType')) {
    $whitelist['civicrm_financial_type'] = 'financial_type';
  }
  return $whitelist;
}