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 AuthorProfile
 6: {
 7:     /** @var array */
 8:     protected $data;
 9:     
10:     /** @var AuthorName */
11:     protected $preferredName;
12:     
13:     /** @var AuthorName[] */
14:     protected $nameVariants;
15:     
16:     public function __construct(array $data)
17:     {
18:         $this->data = $data;
19:     }
20:     
21:     public function getPreferredName()
22:     {
23:         return $this->preferredName ?: $this->preferredName = new AuthorName($this->data['preferred-name']);
24:     }
25:     
26:     public function getNameVariants()
27:     {
28:         return $this->nameVariants ?: $this->nameVariants = array_map(function($nameVariant) {
29:             return new AuthorName($nameVariant);
30:         }, isset($this->data['name-variant']) ? 
31:             isset($this->data['name-variant']['indexed-name']) ? [$this->data['name-variant']] : $this->data['name-variant'] : 
32:             []);
33:     }
34: }
API documentation generated by ApiGen