function PMPAPIDrupal::push in Public Media Platform API Integration 7
Takes node, creates Hypermedia doc, sends it to PMP API.
Parameters
object $data: A PHP stdClass, representing a PMP document.
1 call to PMPAPIDrupal::push()
- PMPAPIDrupalPush::pushEntity in pmpapi_push/
classes/ PMPAPIDrupalPush.php - Pushes entity to PMP
File
- classes/
PMPAPIDrupal.php, line 106 - Defines a class for PMP creation/transmission and retreival/parsing
Class
- PMPAPIDrupal
- @file
Code
function push($data) {
try {
$doc = $this
->getDoc();
if ($doc) {
$doc
->setDocument($data);
return $doc
->save();
}
} catch (Exception $e) {
$message = t('Error pushing to PMP. Message: @exception', array(
'@exception' => $e
->getMessage(),
));
drupal_set_message($message, 'warning');
}
}