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 Debtor extends DataObject
15: {
16: /**
17: * @var string
18: */
19: public $additionalAddressInfo = null;
20:
21: /**
22: * @var string
23: */
24: public $city = null;
25:
26: /**
27: * @var string
28: */
29: public $countryCode = null;
30:
31: /**
32: * @var string
33: */
34: public $firstName = null;
35:
36: /**
37: * @var string
38: */
39: public $houseNumber = null;
40:
41: /**
42: * @var string
43: */
44: public $state = null;
45:
46: /**
47: * @var string
48: */
49: public $stateCode = null;
50:
51: /**
52: * @var string
53: */
54: public $street = null;
55:
56: /**
57: * @var string
58: */
59: public $surname = null;
60:
61: /**
62: * @var string
63: */
64: public $surnamePrefix = null;
65:
66: /**
67: * @var string
68: */
69: public $zip = null;
70:
71: /**
72: * @return object
73: */
74: public function toObject()
75: {
76: $object = parent::toObject();
77: if (!is_null($this->additionalAddressInfo)) {
78: $object->additionalAddressInfo = $this->additionalAddressInfo;
79: }
80: if (!is_null($this->city)) {
81: $object->city = $this->city;
82: }
83: if (!is_null($this->countryCode)) {
84: $object->countryCode = $this->countryCode;
85: }
86: if (!is_null($this->firstName)) {
87: $object->firstName = $this->firstName;
88: }
89: if (!is_null($this->houseNumber)) {
90: $object->houseNumber = $this->houseNumber;
91: }
92: if (!is_null($this->state)) {
93: $object->state = $this->state;
94: }
95: if (!is_null($this->stateCode)) {
96: $object->stateCode = $this->stateCode;
97: }
98: if (!is_null($this->street)) {
99: $object->street = $this->street;
100: }
101: if (!is_null($this->surname)) {
102: $object->surname = $this->surname;
103: }
104: if (!is_null($this->surnamePrefix)) {
105: $object->surnamePrefix = $this->surnamePrefix;
106: }
107: if (!is_null($this->zip)) {
108: $object->zip = $this->zip;
109: }
110: return $object;
111: }
112:
113: /**
114: * @param object $object
115: * @return $this
116: * @throws UnexpectedValueException
117: */
118: public function fromObject($object)
119: {
120: parent::fromObject($object);
121: if (property_exists($object, 'additionalAddressInfo')) {
122: $this->additionalAddressInfo = $object->additionalAddressInfo;
123: }
124: if (property_exists($object, 'city')) {
125: $this->city = $object->city;
126: }
127: if (property_exists($object, 'countryCode')) {
128: $this->countryCode = $object->countryCode;
129: }
130: if (property_exists($object, 'firstName')) {
131: $this->firstName = $object->firstName;
132: }
133: if (property_exists($object, 'houseNumber')) {
134: $this->houseNumber = $object->houseNumber;
135: }
136: if (property_exists($object, 'state')) {
137: $this->state = $object->state;
138: }
139: if (property_exists($object, 'stateCode')) {
140: $this->stateCode = $object->stateCode;
141: }
142: if (property_exists($object, 'street')) {
143: $this->street = $object->street;
144: }
145: if (property_exists($object, 'surname')) {
146: $this->surname = $object->surname;
147: }
148: if (property_exists($object, 'surnamePrefix')) {
149: $this->surnamePrefix = $object->surnamePrefix;
150: }
151: if (property_exists($object, 'zip')) {
152: $this->zip = $object->zip;
153: }
154: return $this;
155: }
156: }
157: