You are here

function pmpapi_push_get_mapping_for_entity in Public Media Platform API Integration 7

Gets the field->attribute mapping for an entity.

Parameters

$entity object: A drupal entity

$type string: The type of entity

Return value

array The field->attribute mapping for an entity.

2 calls to pmpapi_push_get_mapping_for_entity()
pmpapi_push_entity_insert in pmpapi_push/pmpapi_push.module
Implements hook_entity_insert().
pmpapi_push_entity_update in pmpapi_push/pmpapi_push.module
Implements hook_entity_update().

File

pmpapi_push/pmpapi_push.module, line 100
Maps drupal entities to MPM profiles, and pushes them to the PMP API.

Code

function pmpapi_push_get_mapping_for_entity($entity, $type) {
  $uname = pmpapi_push_get_uname($entity, $type);
  $mapped_profile = variable_get('pmpapi_push_' . $uname . '_profile');
  $mapping = variable_get('pmpapi_push_mapping_' . $uname . '_' . $mapped_profile);
  return $mapping;
}