| 1: | <?php |
| 2: | |
| 3: | namespace Scopus\Response; |
| 4: | |
| 5: | class AbstractAuthor extends AuthorName implements IAuthor |
| 6: | { |
| 7: | |
| 8: | protected $data; |
| 9: | |
| 10: | |
| 11: | protected $preferredName; |
| 12: | |
| 13: | public function __construct(array $data) |
| 14: | { |
| 15: | parent::__construct($data, 'ce'); |
| 16: | } |
| 17: | |
| 18: | public function getId() |
| 19: | { |
| 20: | return isset($this->data['@auid']) ? $this->data['@auid'] : null; |
| 21: | } |
| 22: | |
| 23: | public function getSeq() |
| 24: | { |
| 25: | return isset($this->data['@seq']) ? $this->data['@seq'] : null; |
| 26: | } |
| 27: | |
| 28: | public function getPreferredName() |
| 29: | { |
| 30: | if (!isset($this->data['preferred-name'])) { |
| 31: | return null; |
| 32: | } |
| 33: | |
| 34: | return $this->preferredName ?? $this->preferredName = new AuthorName($this->data['preferred-name'], 'ce'); |
| 35: | } |
| 36: | |
| 37: | public function getUrl() |
| 38: | { |
| 39: | return isset($this->data['author-url']) ? $this->data['author-url'] : null; |
| 40: | } |
| 41: | } |
| 42: | |