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 Seller extends DataObject
15: {
16: /**
17: * @var Address|null
18: */
19: public ?Address $address = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $channelCode = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $description = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $externalReferenceId = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $geocode = null;
40:
41: /**
42: * @var string|null
43: */
44: public ?string $id = null;
45:
46: /**
47: * @var string|null
48: */
49: public ?string $invoiceNumber = null;
50:
51: /**
52: * @var bool|null
53: */
54: public ?bool $isForeignRetailer = null;
55:
56: /**
57: * @var string|null
58: */
59: public ?string $mcc = null;
60:
61: /**
62: * @var string|null
63: */
64: public ?string $name = null;
65:
66: /**
67: * @var string|null
68: */
69: public ?string $phoneNumber = null;
70:
71: /**
72: * @var string|null
73: */
74: public ?string $type = null;
75:
76: /**
77: * @return object
78: */
79: public function toObject(): object
80: {
81: $object = parent::toObject();
82: if (!is_null($this->address)) {
83: $object->address = $this->address->toObject();
84: }
85: if (!is_null($this->channelCode)) {
86: $object->channelCode = $this->channelCode;
87: }
88: if (!is_null($this->description)) {
89: $object->description = $this->description;
90: }
91: if (!is_null($this->externalReferenceId)) {
92: $object->externalReferenceId = $this->externalReferenceId;
93: }
94: if (!is_null($this->geocode)) {
95: $object->geocode = $this->geocode;
96: }
97: if (!is_null($this->id)) {
98: $object->id = $this->id;
99: }
100: if (!is_null($this->invoiceNumber)) {
101: $object->invoiceNumber = $this->invoiceNumber;
102: }
103: if (!is_null($this->isForeignRetailer)) {
104: $object->isForeignRetailer = $this->isForeignRetailer;
105: }
106: if (!is_null($this->mcc)) {
107: $object->mcc = $this->mcc;
108: }
109: if (!is_null($this->name)) {
110: $object->name = $this->name;
111: }
112: if (!is_null($this->phoneNumber)) {
113: $object->phoneNumber = $this->phoneNumber;
114: }
115: if (!is_null($this->type)) {
116: $object->type = $this->type;
117: }
118: return $object;
119: }
120:
121: /**
122: * @param object $object
123: *
124: * @return $this
125: * @throws UnexpectedValueException
126: */
127: public function fromObject(object $object): Seller
128: {
129: parent::fromObject($object);
130: if (property_exists($object, 'address')) {
131: if (!is_object($object->address)) {
132: throw new UnexpectedValueException('value \'' . print_r($object->address, true) . '\' is not an object');
133: }
134: $value = new Address();
135: $this->address = $value->fromObject($object->address);
136: }
137: if (property_exists($object, 'channelCode')) {
138: $this->channelCode = $object->channelCode;
139: }
140: if (property_exists($object, 'description')) {
141: $this->description = $object->description;
142: }
143: if (property_exists($object, 'externalReferenceId')) {
144: $this->externalReferenceId = $object->externalReferenceId;
145: }
146: if (property_exists($object, 'geocode')) {
147: $this->geocode = $object->geocode;
148: }
149: if (property_exists($object, 'id')) {
150: $this->id = $object->id;
151: }
152: if (property_exists($object, 'invoiceNumber')) {
153: $this->invoiceNumber = $object->invoiceNumber;
154: }
155: if (property_exists($object, 'isForeignRetailer')) {
156: $this->isForeignRetailer = $object->isForeignRetailer;
157: }
158: if (property_exists($object, 'mcc')) {
159: $this->mcc = $object->mcc;
160: }
161: if (property_exists($object, 'name')) {
162: $this->name = $object->name;
163: }
164: if (property_exists($object, 'phoneNumber')) {
165: $this->phoneNumber = $object->phoneNumber;
166: }
167: if (property_exists($object, 'type')) {
168: $this->type = $object->type;
169: }
170: return $this;
171: }
172: }
173: