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 MandateAddress extends DataObject
15: {
16: /**
17: * @var string
18: */
19: public $city = null;
20:
21: /**
22: * @var string
23: */
24: public $countryCode = null;
25:
26: /**
27: * @var string
28: */
29: public $houseNumber = null;
30:
31: /**
32: * @var string
33: */
34: public $street = null;
35:
36: /**
37: * @var string
38: */
39: public $zip = null;
40:
41: /**
42: * @return object
43: */
44: public function toObject()
45: {
46: $object = parent::toObject();
47: if (!is_null($this->city)) {
48: $object->city = $this->city;
49: }
50: if (!is_null($this->countryCode)) {
51: $object->countryCode = $this->countryCode;
52: }
53: if (!is_null($this->houseNumber)) {
54: $object->houseNumber = $this->houseNumber;
55: }
56: if (!is_null($this->street)) {
57: $object->street = $this->street;
58: }
59: if (!is_null($this->zip)) {
60: $object->zip = $this->zip;
61: }
62: return $object;
63: }
64:
65: /**
66: * @param object $object
67: * @return $this
68: * @throws UnexpectedValueException
69: */
70: public function fromObject($object)
71: {
72: parent::fromObject($object);
73: if (property_exists($object, 'city')) {
74: $this->city = $object->city;
75: }
76: if (property_exists($object, 'countryCode')) {
77: $this->countryCode = $object->countryCode;
78: }
79: if (property_exists($object, 'houseNumber')) {
80: $this->houseNumber = $object->houseNumber;
81: }
82: if (property_exists($object, 'street')) {
83: $this->street = $object->street;
84: }
85: if (property_exists($object, 'zip')) {
86: $this->zip = $object->zip;
87: }
88: return $this;
89: }
90: }
91: