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