You are here

function civicrm_entity_metadata_civicrm_entity_get_properties in CiviCRM Entity 7

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

Implement getter callback.

NB this is in a separate file called callbacks.inc in entity module

  • I couldn't see how it was loaded so maybe the name has some

magic?

Parameters

$data:

$options:

$name:

$type:

$info:

Return value

object

1 string reference to 'civicrm_entity_metadata_civicrm_entity_get_properties'
_civicrm_entity_getproperties in ./civicrm_entity.module
Calculate fields for entities

File

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

Code

function civicrm_entity_metadata_civicrm_entity_get_properties($data, $options, $name, $type, $info) {
  $entity = civicrm_api($info['property_info']['entity'], 'get', array(
    'version' => 3,
    'id' => $data->{$info}['property_info']['field'],
    'sequential' => 1,
  ));
  return (object) $entity['values'][0];
}