You are here

function pmpapi_push_entity_insert in Public Media Platform API Integration 7

Implements hook_entity_insert().

File

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

Code

function pmpapi_push_entity_insert($entity, $type) {
  if (pmpapi_push_entity_ok_to_push($entity, $type)) {
    $mapping = pmpapi_push_get_mapping_for_entity($entity, $type);
    $uname = pmpapi_push_get_uname($entity, $type);
    $mapped_profile = variable_get('pmpapi_push_' . $uname . '_profile');
    pmpapi_push_push_entity_to_pmp($entity, $type, $mapped_profile, $mapping);
  }
}