function PMPAPIDrupal::delete in Public Media Platform API Integration 7
Deletes a doc from the PMP
Parameters
string $guid: A UUID v4 GUID
File
- classes/
PMPAPIDrupal.php, line 350 - Defines a class for PMP creation/transmission and retreival/parsing
Class
- PMPAPIDrupal
- @file
Code
function delete($guid) {
try {
$path = 'docs/' . $guid;
$pmp = $this
->getDoc($path);
if ($pmp) {
$pmp
->delete();
}
else {
$message = t('Unable to delete PMP doc with guid = @guid', array(
'@guid' => $guid,
));
drupal_set_message($message, 'warning');
}
} catch (Exception $e) {
$message = t('Error deleting from the PMP. Message: @exception', array(
'@exception' => $e
->getMessage(),
));
drupal_set_message($message, 'warning');
}
}