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 BankDetailsResponse extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $bankAccountBban = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $bankAccountIban = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $bankData = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $swift = null; |
35: | |
36: | |
37: | |
38: | |
39: | public function toObject() |
40: | { |
41: | $object = parent::toObject(); |
42: | if (!is_null($this->bankAccountBban)) { |
43: | $object->bankAccountBban = $this->bankAccountBban->toObject(); |
44: | } |
45: | if (!is_null($this->bankAccountIban)) { |
46: | $object->bankAccountIban = $this->bankAccountIban->toObject(); |
47: | } |
48: | if (!is_null($this->bankData)) { |
49: | $object->bankData = $this->bankData->toObject(); |
50: | } |
51: | if (!is_null($this->swift)) { |
52: | $object->swift = $this->swift->toObject(); |
53: | } |
54: | return $object; |
55: | } |
56: | |
57: | |
58: | |
59: | |
60: | |
61: | |
62: | public function fromObject($object) |
63: | { |
64: | parent::fromObject($object); |
65: | if (property_exists($object, 'bankAccountBban')) { |
66: | if (!is_object($object->bankAccountBban)) { |
67: | throw new UnexpectedValueException('value \'' . print_r($object->bankAccountBban, true) . '\' is not an object'); |
68: | } |
69: | $value = new BankAccountBban(); |
70: | $this->bankAccountBban = $value->fromObject($object->bankAccountBban); |
71: | } |
72: | if (property_exists($object, 'bankAccountIban')) { |
73: | if (!is_object($object->bankAccountIban)) { |
74: | throw new UnexpectedValueException('value \'' . print_r($object->bankAccountIban, true) . '\' is not an object'); |
75: | } |
76: | $value = new BankAccountIban(); |
77: | $this->bankAccountIban = $value->fromObject($object->bankAccountIban); |
78: | } |
79: | if (property_exists($object, 'bankData')) { |
80: | if (!is_object($object->bankData)) { |
81: | throw new UnexpectedValueException('value \'' . print_r($object->bankData, true) . '\' is not an object'); |
82: | } |
83: | $value = new BankData(); |
84: | $this->bankData = $value->fromObject($object->bankData); |
85: | } |
86: | if (property_exists($object, 'swift')) { |
87: | if (!is_object($object->swift)) { |
88: | throw new UnexpectedValueException('value \'' . print_r($object->swift, true) . '\' is not an object'); |
89: | } |
90: | $value = new Swift(); |
91: | $this->swift = $value->fromObject($object->swift); |
92: | } |
93: | return $this; |
94: | } |
95: | } |
96: | |