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
18: */
19: public $accountNumber = null;
20:
21: /**
22: * @var string
23: */
24: public $accountNumberType = null;
25:
26: /**
27: * @var Address
28: */
29: public $address = null;
30:
31: /**
32: * @var string
33: */
34: public $dateOfBirth = null;
35:
36: /**
37: * @var AfrName
38: */
39: public $name = null;
40:
41: /**
42: * @var string
43: */
44: public $partialPan = null;
45:
46: /**
47: * @return object
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: * @param object $object
75: * @return $this
76: * @throws UnexpectedValueException
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: