1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class BankDetailsResponse extends DataObject
15: {
16: /**
17: * @var BankAccountBban
18: */
19: public $bankAccountBban = null;
20:
21: /**
22: * @var BankAccountIban
23: */
24: public $bankAccountIban = null;
25:
26: /**
27: * @var BankData
28: */
29: public $bankData = null;
30:
31: /**
32: * @var Swift
33: */
34: public $swift = null;
35:
36: /**
37: * @return object
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: * @param object $object
59: * @return $this
60: * @throws UnexpectedValueException
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: