You are here

function PMPAPIDrupalPull::pullDoc in Public Media Platform API Integration 7

Pulls a single doc from the PMP

Parameters

array $guid: A PMP GUID

Return value

object The full PMP object.

File

pmpapi_pull/classes/PMPAPIDrupalPull.php, line 31
Contains PMPAPIDrupalPull.

Class

PMPAPIDrupalPull
Turns PMP hypermedia docs in Drupal entities.

Code

function pullDoc($guid) {
  $this
    ->pull(array(
    'guid' => $guid,
  ));
  if (empty($this->errors) && !empty($this->query->results->docs[0])) {
    $doc = $this->query->results->docs[0];
    $docs = array(
      $doc,
    );
    drupal_alter('pmpapi_pull_docs_prepare', $docs);
    return $this
      ->saveEntity($doc);
  }
}