You are here

function party_entity_property_info_alter in Party 8.2

Same name and namespace in other branches
  1. 7 party.info.inc \party_entity_property_info_alter()

Implements hook_entity_property_info_alter().

Register our attached entities as entity properties so that other modules can build items from it, e.g. Search API.

File

./party.module, line 1576
Provides a generic CRM party entity.

Code

function party_entity_property_info_alter(&$property_info) {
  $properties =& $property_info['party']['properties'];
  foreach (party_get_data_set_info() as $data_set_name => $set_info) {
    $properties[$data_set_name] = array(
      'label' => t('@label (Attached Entities)', array(
        '@label' => $set_info['label'],
      )),
      'description' => t('The attached entities that are party of the @label data set.', array(
        '@label' => $set_info['label'],
      )),
      'type' => $set_info['entity type'],
      'bundle' => $set_info['entity bundle'],
      'computed' => TRUE,
      'getter callback' => 'party_property_dataset_get',
    );
  }
}