You are here

public function BiblioEntrezPubmedArticle::getBiblio in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 modules/pubmed/EntrezPubmedArticle.php \BiblioEntrezPubmedArticle::getBiblio()
  2. 7 modules/pubmed/EntrezPubmedArticle.php \BiblioEntrezPubmedArticle::getBiblio()
  3. 7.2 modules/pubmed/EntrezPubmedArticle.php \BiblioEntrezPubmedArticle::getBiblio()

Returns article elements as an associative array suitable for import into a biblio node.

Return value

array

File

pubmed/EntrezPubmedArticle.php, line 66
EntrezPubmedArticle.php Provides a class for handling PubMed articles retrieved with EFetch. Orginally writen by Stefan Freudenberg

Class

BiblioEntrezPubmedArticle
@file EntrezPubmedArticle.php Provides a class for handling PubMed articles retrieved with EFetch. Orginally writen by Stefan Freudenberg

Code

public function getBiblio() {
  if (empty($this->biblio)) {
    if (variable_get('biblio_auto_citekey', 1)) {
      $citekey = '';
    }
    else {
      $citekey = $this->id;
    }
    $this->biblio = array(
      'title' => (string) $this->article->Article->ArticleTitle,
      'biblio_citekey' => $citekey,
      'biblio_pubmed_id' => $this->id,
      'biblio_pubmed_md5' => $this->md5,
      'biblio_contributors' => $this
        ->contributors(),
      // MedlineCitations are always articles from journals or books
      'biblio_type' => 102,
      'biblio_date' => $this
        ->date(),
      'biblio_year' => substr($this
        ->date(), 0, 4),
      'biblio_secondary_title' => (string) $this->article->Article->Journal->Title,
      'biblio_alternate_title' => (string) $this->article->Article->Journal->ISOAbbreviation,
      'biblio_volume' => (string) $this->article->Article->Journal->JournalIssue->Volume,
      'biblio_issue' => (string) $this->article->Article->Journal->JournalIssue->Issue,
      'biblio_issn' => (string) $this->article->Article->Journal->ISSN,
      'biblio_pages' => (string) $this->article->Article->Pagination->MedlinePgn,
      'biblio_abst_e' => $this
        ->abst(),
      'biblio_custom1' => "http://www.ncbi.nlm.nih.gov/pubmed/{$this->id}?dopt=Abstract",
      'biblio_keywords' => $this
        ->keywords(),
      'biblio_lang' => $this
        ->lang(),
    );
    $doi = $this->article
      ->xpath('//ELocationID[@EIdType="doi"]/text()');
    if (empty($doi)) {
      $doi = $this->article
        ->xpath('//ArticleId[@IdType="doi"]/text()');
    }
    if (!empty($doi)) {
      $this->biblio['biblio_doi'] = (string) $doi[0];
    }
  }
  return $this->biblio;
}