1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | use Worldline\Connect\Sdk\Domain\DataObject; |
10: | |
11: | |
12: | |
13: | |
14: | class PaymentProduct863SpecificData extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $integrationTypes = null; |
20: | |
21: | |
22: | |
23: | |
24: | public function toObject() |
25: | { |
26: | $object = parent::toObject(); |
27: | if (!is_null($this->integrationTypes)) { |
28: | $object->integrationTypes = []; |
29: | foreach ($this->integrationTypes as $element) { |
30: | if (!is_null($element)) { |
31: | $object->integrationTypes[] = $element; |
32: | } |
33: | } |
34: | } |
35: | return $object; |
36: | } |
37: | |
38: | |
39: | |
40: | |
41: | |
42: | |
43: | public function fromObject($object) |
44: | { |
45: | parent::fromObject($object); |
46: | if (property_exists($object, 'integrationTypes')) { |
47: | if (!is_array($object->integrationTypes) && !is_object($object->integrationTypes)) { |
48: | throw new UnexpectedValueException('value \'' . print_r($object->integrationTypes, true) . '\' is not an array or object'); |
49: | } |
50: | $this->integrationTypes = []; |
51: | foreach ($object->integrationTypes as $element) { |
52: | $this->integrationTypes[] = $element; |
53: | } |
54: | } |
55: | return $this; |
56: | } |
57: | } |
58: | |