1 | <?php |
||
6 | class CountryOfOrigin implements HydratableInterface |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private $country; |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $source; |
||
17 | |||
18 | 30 | public function hydrateXml(\SimpleXMLElement $xml) |
|
19 | { |
||
20 | 30 | if (!isset($xml->CountryOfOrigin)) { |
|
21 | 3 | return; |
|
22 | } |
||
23 | |||
24 | 27 | $this->country = (string)$xml->CountryOfOrigin->Country; |
|
25 | 27 | $this->source = (string)$xml->CountryOfOrigin->Source; |
|
26 | 27 | } |
|
27 | |||
28 | /** |
||
29 | * @return string |
||
30 | */ |
||
31 | 9 | public function getCountry() : ?string |
|
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | 9 | public function getSource() : ?string |
|
43 | } |
||
44 |