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 CreateMandateBase extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $alias = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $customer = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $customerReference = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $language = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $recurrenceType = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $signatureType = null; |
45: | |
46: | |
47: | |
48: | |
49: | public $uniqueMandateReference = null; |
50: | |
51: | |
52: | |
53: | |
54: | public function toObject() |
55: | { |
56: | $object = parent::toObject(); |
57: | if (!is_null($this->alias)) { |
58: | $object->alias = $this->alias; |
59: | } |
60: | if (!is_null($this->customer)) { |
61: | $object->customer = $this->customer->toObject(); |
62: | } |
63: | if (!is_null($this->customerReference)) { |
64: | $object->customerReference = $this->customerReference; |
65: | } |
66: | if (!is_null($this->language)) { |
67: | $object->language = $this->language; |
68: | } |
69: | if (!is_null($this->recurrenceType)) { |
70: | $object->recurrenceType = $this->recurrenceType; |
71: | } |
72: | if (!is_null($this->signatureType)) { |
73: | $object->signatureType = $this->signatureType; |
74: | } |
75: | if (!is_null($this->uniqueMandateReference)) { |
76: | $object->uniqueMandateReference = $this->uniqueMandateReference; |
77: | } |
78: | return $object; |
79: | } |
80: | |
81: | |
82: | |
83: | |
84: | |
85: | |
86: | public function fromObject($object) |
87: | { |
88: | parent::fromObject($object); |
89: | if (property_exists($object, 'alias')) { |
90: | $this->alias = $object->alias; |
91: | } |
92: | if (property_exists($object, 'customer')) { |
93: | if (!is_object($object->customer)) { |
94: | throw new UnexpectedValueException('value \'' . print_r($object->customer, true) . '\' is not an object'); |
95: | } |
96: | $value = new MandateCustomer(); |
97: | $this->customer = $value->fromObject($object->customer); |
98: | } |
99: | if (property_exists($object, 'customerReference')) { |
100: | $this->customerReference = $object->customerReference; |
101: | } |
102: | if (property_exists($object, 'language')) { |
103: | $this->language = $object->language; |
104: | } |
105: | if (property_exists($object, 'recurrenceType')) { |
106: | $this->recurrenceType = $object->recurrenceType; |
107: | } |
108: | if (property_exists($object, 'signatureType')) { |
109: | $this->signatureType = $object->signatureType; |
110: | } |
111: | if (property_exists($object, 'uniqueMandateReference')) { |
112: | $this->uniqueMandateReference = $object->uniqueMandateReference; |
113: | } |
114: | return $this; |
115: | } |
116: | } |
117: | |