1: <?php
2:
3: namespace Scopus\Response;
4:
5: class Entry extends AbstractCoredata implements IAbstract
6: {
7:
8: protected $data;
9:
10:
11: protected $links;
12:
13:
14: protected $affiliations;
15:
16:
17: protected $authors;
18:
19: public function __construct(array $data)
20: {
21: parent::__construct($data);
22: }
23:
24: public function getLinks()
25: {
26: return $this->links ?: $this->links = new EntryLinks($this->data['link']);
27: }
28:
29: public function getCreator()
30: {
31: return $this->data['dc:creator'];
32: }
33:
34: 35: 36:
37: public function getCreatorAuthor()
38: {
39: $matches = array_filter($this->getAuthors(), function(EntryAuthor $author) {
40: return $author->getName() === $this->getCreator();
41: });
42: if ($matches) {
43: return array_values($matches)[0];
44: }
45: }
46:
47: public function getCoverDisplayDate()
48: {
49: return $this->data['prism:coverDisplayDate'];
50: }
51:
52: public function getAffiliations()
53: {
54: if (isset($this->data['affiliation'])) {
55: return $this->affiliations ?: $this->affiliations = array_map(function($affiliation) {
56: return new Affiliation($affiliation);
57: }, $this->data['affiliation']);
58: }
59: }
60:
61: public function countAffiliations()
62: {
63: return isset($this->data['affiliation']) ? count($this->data['affiliation']) : 0;
64: }
65:
66: public function getSubtype()
67: {
68: return $this->data['subtype'];
69: }
70:
71: public function getSubtypeDescription()
72: {
73: return $this->data['subtypeDescription'];
74: }
75:
76: 77: 78:
79: public function getAuthors()
80: {
81: if (isset($this->data['author'])) {
82: return $this->authors ?: $this->authors = array_map(function($author) {
83: return new EntryAuthor($author);
84: }, $this->data['author']);
85: }
86: }
87:
88: public function countAuthors()
89: {
90: return isset($this->data['author']) ? count($this->data['author']) : 0;
91: }
92:
93: public function getAuthkeywords()
94: {
95: return $this->data['authkeywords'];
96: }
97: }