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 AccountFundingRecipient extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $accountNumber = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $accountNumberType = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $address = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $dateOfBirth = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $name = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $partialPan = null; |
45: | |
46: | |
47: | |
48: | |
49: | public function toObject() |
50: | { |
51: | $object = parent::toObject(); |
52: | if (!is_null($this->accountNumber)) { |
53: | $object->accountNumber = $this->accountNumber; |
54: | } |
55: | if (!is_null($this->accountNumberType)) { |
56: | $object->accountNumberType = $this->accountNumberType; |
57: | } |
58: | if (!is_null($this->address)) { |
59: | $object->address = $this->address->toObject(); |
60: | } |
61: | if (!is_null($this->dateOfBirth)) { |
62: | $object->dateOfBirth = $this->dateOfBirth; |
63: | } |
64: | if (!is_null($this->name)) { |
65: | $object->name = $this->name->toObject(); |
66: | } |
67: | if (!is_null($this->partialPan)) { |
68: | $object->partialPan = $this->partialPan; |
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, 'accountNumber')) { |
82: | $this->accountNumber = $object->accountNumber; |
83: | } |
84: | if (property_exists($object, 'accountNumberType')) { |
85: | $this->accountNumberType = $object->accountNumberType; |
86: | } |
87: | if (property_exists($object, 'address')) { |
88: | if (!is_object($object->address)) { |
89: | throw new UnexpectedValueException('value \'' . print_r($object->address, true) . '\' is not an object'); |
90: | } |
91: | $value = new Address(); |
92: | $this->address = $value->fromObject($object->address); |
93: | } |
94: | if (property_exists($object, 'dateOfBirth')) { |
95: | $this->dateOfBirth = $object->dateOfBirth; |
96: | } |
97: | if (property_exists($object, 'name')) { |
98: | if (!is_object($object->name)) { |
99: | throw new UnexpectedValueException('value \'' . print_r($object->name, true) . '\' is not an object'); |
100: | } |
101: | $value = new AfrName(); |
102: | $this->name = $value->fromObject($object->name); |
103: | } |
104: | if (property_exists($object, 'partialPan')) { |
105: | $this->partialPan = $object->partialPan; |
106: | } |
107: | return $this; |
108: | } |
109: | } |
110: | |