You are here

private function BiblioEntrezPubmedArticle::contributors in Bibliography Module 6

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

Returns the list of contributors for import obtained from the given MedlineCitation element.

Return value

array the contributors of the article

1 call to BiblioEntrezPubmedArticle::contributors()
BiblioEntrezPubmedArticle::getBiblio in pubmed/EntrezPubmedArticle.php
Returns article elements as an associative array suitable for import into a biblio node.

File

pubmed/EntrezPubmedArticle.php, line 118
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

private function contributors() {
  $contributors = array();
  if (isset($this->article->Article->AuthorList->Author)) {
    foreach ($this->article->Article->AuthorList->Author as $author) {
      if (isset($author->CollectiveName)) {
        $category = 5;

        // corporate author
        $name = (string) $author->CollectiveName;
      }
      else {
        $category = 1;

        //primary (human) author
        $lastname = (string) $author->LastName;
        if (isset($author->ForeName)) {
          $name = $lastname . ', ' . (string) $author->ForeName;
        }
        elseif (isset($author->FirstName)) {
          $name = $lastname . ', ' . (string) $author->FirstName;
        }
        elseif (isset($author->Initials)) {
          $name = $lastname . ', ' . (string) $author->Initials;
        }
      }
      $contributors[$category][] = array(
        'name' => $name,
      );
    }
  }
  return $contributors;
}