1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class MerchantData extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $address = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $city = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $countryCode = null;
29:
30: /**
31: * @var int|null
32: */
33: public ?int $merchantCategoryCode = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $name = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $postalCode = null;
44:
45: /**
46: * @var string|null
47: */
48: public ?string $stateCode = null;
49:
50: /**
51: * @return object
52: */
53: public function toObject(): object
54: {
55: $object = parent::toObject();
56: if (!is_null($this->address)) {
57: $object->address = $this->address;
58: }
59: if (!is_null($this->city)) {
60: $object->city = $this->city;
61: }
62: if (!is_null($this->countryCode)) {
63: $object->countryCode = $this->countryCode;
64: }
65: if (!is_null($this->merchantCategoryCode)) {
66: $object->merchantCategoryCode = $this->merchantCategoryCode;
67: }
68: if (!is_null($this->name)) {
69: $object->name = $this->name;
70: }
71: if (!is_null($this->postalCode)) {
72: $object->postalCode = $this->postalCode;
73: }
74: if (!is_null($this->stateCode)) {
75: $object->stateCode = $this->stateCode;
76: }
77: return $object;
78: }
79:
80: /**
81: * @param object $object
82: *
83: * @return $this
84: * @throws UnexpectedValueException
85: */
86: public function fromObject(object $object): MerchantData
87: {
88: parent::fromObject($object);
89: if (property_exists($object, 'address')) {
90: $this->address = $object->address;
91: }
92: if (property_exists($object, 'city')) {
93: $this->city = $object->city;
94: }
95: if (property_exists($object, 'countryCode')) {
96: $this->countryCode = $object->countryCode;
97: }
98: if (property_exists($object, 'merchantCategoryCode')) {
99: $this->merchantCategoryCode = $object->merchantCategoryCode;
100: }
101: if (property_exists($object, 'name')) {
102: $this->name = $object->name;
103: }
104: if (property_exists($object, 'postalCode')) {
105: $this->postalCode = $object->postalCode;
106: }
107: if (property_exists($object, 'stateCode')) {
108: $this->stateCode = $object->stateCode;
109: }
110: return $this;
111: }
112: }
113: