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 SearchResults
 6: {
 7:     /** @var array */
 8:     protected $data;
 9:     
10:     /** @var SearchLinks */
11:     protected $links;
12:     
13:     /** @var Entry[] */
14:     protected $entries;
15:     
16:     public function __construct(array $data)
17:     {
18:         $this->data = $data;
19:     }
20: 
21:     public function getTotalResults()
22:     {
23:         return $this->data['opensearch:totalResults'];
24:     }
25:     
26:     public function getStartIndex()
27:     {
28:         return $this->data['opensearch:startIndex'];
29:     }
30:     
31:     public function getItemsPerPage()
32:     {
33:         return $this->data['opensearch:itemsPerPage'];
34:     }
35:     
36:     public function getQuery()
37:     {
38:         return $this->data['opensearch:Query'];
39:     }
40:     
41:     public function getLinks()
42:     {
43:         return $this->links ?: $this->links = new SearchLinks($this->data['link']);
44:     }
45: 
46:     /**
47:      * @return Entry[]
48:      */
49:     public function getEntries()
50:     {
51:         if (isset($this->data['entry'])) {
52:             return $this->entries ?: $this->entries = array_map(function($entry) {
53:                 return new Entry($entry);
54:             }, $this->data['entry']);
55:         }
56:     }
57:     
58:     public function countEntries()
59:     {
60:         return isset($this->data['entry']) ? count($this->data['entry']) : 0; 
61:     }
62: }
API documentation generated by ApiGen