| 1: | <?php |
| 2: | |
| 3: | namespace Scopus\Response; |
| 4: | |
| 5: | class Correspondence |
| 6: | { |
| 7: | /** @var array */ |
| 8: | protected $data; |
| 9: | |
| 10: | /** @var */ |
| 11: | protected $person; |
| 12: | |
| 13: | public function __construct(array $data) |
| 14: | { |
| 15: | $this->data = $data; |
| 16: | } |
| 17: | |
| 18: | public function getPerson() |
| 19: | { |
| 20: | if (isset($this->data['person'])) { |
| 21: | return $this->person ?: $this->person = new CorrespondencePerson($this->data['person']); |
| 22: | } |
| 23: | } |
| 24: | } |