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 AccountFundingRecipient extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $accountNumber = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $accountNumberType = null;
25:
26: /**
27: * @var Address|null
28: */
29: public ?Address $address = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $dateOfBirth = null;
35:
36: /**
37: * @var AfrName|null
38: */
39: public ?AfrName $name = null;
40:
41: /**
42: * @var string|null
43: */
44: public ?string $partialPan = null;
45:
46: /**
47: * @return object
48: */
49: public function toObject(): object
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: * @param object $object
75: *
76: * @return $this
77: * @throws UnexpectedValueException
78: */
79: public function fromObject(object $object): AccountFundingRecipient
80: {
81: parent::fromObject($object);
82: if (property_exists($object, 'accountNumber')) {
83: $this->accountNumber = $object->accountNumber;
84: }
85: if (property_exists($object, 'accountNumberType')) {
86: $this->accountNumberType = $object->accountNumberType;
87: }
88: if (property_exists($object, 'address')) {
89: if (!is_object($object->address)) {
90: throw new UnexpectedValueException('value \'' . print_r($object->address, true) . '\' is not an object');
91: }
92: $value = new Address();
93: $this->address = $value->fromObject($object->address);
94: }
95: if (property_exists($object, 'dateOfBirth')) {
96: $this->dateOfBirth = $object->dateOfBirth;
97: }
98: if (property_exists($object, 'name')) {
99: if (!is_object($object->name)) {
100: throw new UnexpectedValueException('value \'' . print_r($object->name, true) . '\' is not an object');
101: }
102: $value = new AfrName();
103: $this->name = $value->fromObject($object->name);
104: }
105: if (property_exists($object, 'partialPan')) {
106: $this->partialPan = $object->partialPan;
107: }
108: return $this;
109: }
110: }
111: