You are here

function pmpapi_remove in Public Media Platform API Integration 7

Removes a doc from the PMP

Parameters

string $guid: The GUID of the doc to be removed.

10 calls to pmpapi_remove()
PMPAPIPermissionsWebTestCase::tearDown in pmpapi_permissions/tests/pmpapi_permissions.test
Delete created files and temporary files directory, delete the tables created by setUp(), and reset the database prefix.
PMPAPIPullWebTestCase::testPmpAPIEmbargoedThenValid in pmpapi_pull/tests/pmpapi_pull.test
Checks that node is published when it becomes valid.
PMPAPIPullWebTestCase::testPmpAPIPullEmbargoedStory in pmpapi_pull/tests/pmpapi_pull.test
Checks for status = 0 on pulled embargoed story.
PMPAPIPullWebTestCase::testPmpAPIPullExpiredStory in pmpapi_pull/tests/pmpapi_pull.test
Checks for status = 0 on pulled expired story.
PMPAPIPullWebTestCase::testPmpAPIValidThenExpired in pmpapi_pull/tests/pmpapi_pull.test
Checks that node is unpublished when it becomes expired.

... See full list

File

./pmpapi.module, line 134
Creates basic calls to the PMP API.

Code

function pmpapi_remove($guid) {
  $pmp = new PMPAPIDrupal();
  try {
    $pmp
      ->delete($guid);
    pmp_delete_guid_from_queue($guid);
    return $pmp;
  } catch (Exception $e) {
    drupal_set_message(t('Error deleting doc from PMP. Deletion will be re-tried at next cron run.'), 'warning');
    pmpapi_increment_delete_tries($guid);
    return FALSE;
  }
}