function PMPAPIDrupalPush::pushEntity in Public Media Platform API Integration 7
Pushes entity to PMP
Parameters
object $entity: Any drupal entity object
string $type: The type of entity (node, file, etc.)
$profile string: The type of PMP profile that will be created
array $mapping: A mapping of entity fields to PMP profile attributes (etc.)
Return value
object The full PMP object (after ->push()).
File
- pmpapi_push/
classes/ PMPAPIDrupalPush.php, line 30 - Contains PMPAPIDrupalPush.
Class
- PMPAPIDrupalPush
- Creates hypermedia docs and pushes entities.
Code
function pushEntity($entity, $type, $profile, $mapping) {
$data = $this
->createHypermediaDoc($entity, $type, $profile, $mapping);
$pmp = $this
->push($data);
if ($pmp) {
$pmp->pmpapi_guid = $entity->pmpapi_guid;
return $pmp;
}
}