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 Abstracts implements IAbstract
 6: {
 7:     /** @var array */
 8:     protected $data;
 9:     
10:     /** @var AbstractCoredata */
11:     protected $coredata;
12:     
13:     /** @var AbstractAuthor[] */
14:     protected $authors;
15:     
16:     /** @var AbstractItem */
17:     protected $item;
18:     
19:     public function __construct(array $data)
20:     {
21:         $this->data = $data;
22:     }
23:     
24:     public function getCoredata()
25:     {
26:         return $this->coredata ?: $this->coredata = new AbstractCoredata($this->data['coredata']);
27:     }
28: 
29:     /**
30:      * @return AbstractAuthor[]
31:      */
32:     public function getAuthors()
33:     {
34:         if (isset($this->data['authors']['author'])) {
35:             return $this->authors ?: $this->authors = array_map(function($author) {
36:                 return new AbstractAuthor($author);
37:             }, $this->data['authors']['author']);
38:         }
39:     }
40: 
41:     /**
42:      * @return int
43:      */
44:     public function countAuthors()
45:     {
46:         return isset($this->data['authors']['author']) ? count($this->data['authors']['author']) : 0;
47:     }
48:     
49:     public function getItem()
50:     {
51:         return $this->item ?: $this->item = new AbstractItem($this->data['item']);
52:     }
53: }
API documentation generated by ApiGen