Overview

Namespaces

  • Scopus
    • Exception
    • Response
    • Util

Classes

  • Scopus\Response\AbstractAuthor
  • Scopus\Response\AbstractCoredata
  • Scopus\Response\AbstractItem
  • Scopus\Response\Abstracts
  • Scopus\Response\Affiliation
  • Scopus\Response\Author
  • Scopus\Response\AuthorGroup
  • Scopus\Response\AuthorName
  • Scopus\Response\AuthorProfile
  • Scopus\Response\BaseLinks
  • Scopus\Response\Bibrecord
  • Scopus\Response\BibrecordHead
  • Scopus\Response\Correspondence
  • Scopus\Response\CorrespondencePerson
  • Scopus\Response\Entry
  • Scopus\Response\EntryAuthor
  • Scopus\Response\EntryLinks
  • Scopus\Response\SearchLinks
  • Scopus\Response\SearchResults
  • Scopus\Response\Source
  • Scopus\ScopusApi
  • Scopus\SearchQuery
  • Scopus\Util\XmlUtil

Interfaces

  • Scopus\Response\IAbstract
  • Scopus\Response\IAuthor
  • Scopus\Response\IAuthorName

Exceptions

  • Scopus\Exception\JsonException
  • Scopus\Exception\XmlException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace Scopus\Response;
 4: 
 5: class Author
 6: {
 7:     /** @var array */
 8:     protected $data;
 9:     
10:     /** @var Affiliation */
11:     protected $affiliation;
12:     
13:     /** @var Affiliation[] */
14:     protected $affiliation_history;
15:     
16:     /** @var AuthorProfile */
17:     protected $profile;
18: 
19:     public function __construct(array $data)
20:     {
21:         $this->data = $data;
22:     }
23:     
24:     public function getAffiliation()
25:     {
26:         return $this->affiliation ?: $this->affiliation = new Affiliation($this->prepareAffiliationData($this->data['affiliation-current']));
27:     }
28:     
29:     public function getAffiliationHistory()
30:     {
31:         if (isset($this->data['affiliation-history'])) {
32:             return $this->affiliation_history ?: $this->affiliation_history = array_map(function($affiliation) {
33:                 return new Affiliation($this->prepareAffiliationData($affiliation));
34:             }, $this->data['affiliation-history']);
35:         }
36:     }
37:     
38:     public function getProfile()
39:     {
40:         if (isset($this->data['author-profile'])) {
41:             return $this->profile ?: $this->profile = new AuthorProfile($this->data['author-profile']);
42:         }
43:     }
44:     
45:     protected function prepareAffiliationData($affiliation)
46:     {
47:         return [
48:             'afid' => $affiliation['@id'],
49:             'affiliation-url' => $affiliation['@href']
50:         ];
51:     }
52:     
53: }
API documentation generated by ApiGen