You are here

function pmpapi_pull_pull_doc in Public Media Platform API Integration 7

Pulls a single PMP doc.

Parameters

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

$cache boolean: Whether or not pull should first check cache.

11 calls to pmpapi_pull_pull_doc()
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::testPmpAPIPullPullImage in pmpapi_pull/tests/pmpapi_pull.test
Pulls an image doc from the PMP and maps it to an image entity.
PMPAPIPullWebTestCase::testPmpAPIPullPullStory in pmpapi_pull/tests/pmpapi_pull.test
Pulls a story doc from the PMP and maps it to a node.

... See full list

File

pmpapi_pull/pmpapi_pull.module, line 159
Allows admins to pull content from the PMP API, and turn PMP docs into (locally-stored, independent) drupal entities.

Code

function pmpapi_pull_pull_doc($guid, $cache = FALSE) {
  if (variable_get('pmpapi_pull_pull_active')) {
    $pmp = new PMPAPIDrupalPull($cache);
    $entity = $pmp
      ->pullDoc($guid);
    if ($entity) {
      return $entity;
    }
    else {
      drupal_set_message(t('No doc could be found in the PMP with this guid.'), 'warning');
    }
  }
  else {
    drupal_set_message(t('Unable to pull doc with guid = @guid. Pull is not currently active.', array(
      '@guid' => $guid,
    )), 'warning');
  }
}