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
18: */
19: public $address = null;
20:
21: /**
22: * @var string
23: */
24: public $channelCode = null;
25:
26: /**
27: * @var string
28: */
29: public $description = null;
30:
31: /**
32: * @var string
33: */
34: public $externalReferenceId = null;
35:
36: /**
37: * @var string
38: */
39: public $geocode = null;
40:
41: /**
42: * @var string
43: */
44: public $id = null;
45:
46: /**
47: * @var string
48: */
49: public $invoiceNumber = null;
50:
51: /**
52: * @var bool
53: */
54: public $isForeignRetailer = null;
55:
56: /**
57: * @var string
58: */
59: public $mcc = null;
60:
61: /**
62: * @var string
63: */
64: public $name = null;
65:
66: /**
67: * @var string
68: */
69: public $phoneNumber = null;
70:
71: /**
72: * @var string
73: */
74: public $type = null;
75:
76: /**
77: * @return object
78: */
79: public function toObject()
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: * @return $this
124: * @throws UnexpectedValueException
125: */
126: public function fromObject($object)
127: {
128: parent::fromObject($object);
129: if (property_exists($object, 'address')) {
130: if (!is_object($object->address)) {
131: throw new UnexpectedValueException('value \'' . print_r($object->address, true) . '\' is not an object');
132: }
133: $value = new Address();
134: $this->address = $value->fromObject($object->address);
135: }
136: if (property_exists($object, 'channelCode')) {
137: $this->channelCode = $object->channelCode;
138: }
139: if (property_exists($object, 'description')) {
140: $this->description = $object->description;
141: }
142: if (property_exists($object, 'externalReferenceId')) {
143: $this->externalReferenceId = $object->externalReferenceId;
144: }
145: if (property_exists($object, 'geocode')) {
146: $this->geocode = $object->geocode;
147: }
148: if (property_exists($object, 'id')) {
149: $this->id = $object->id;
150: }
151: if (property_exists($object, 'invoiceNumber')) {
152: $this->invoiceNumber = $object->invoiceNumber;
153: }
154: if (property_exists($object, 'isForeignRetailer')) {
155: $this->isForeignRetailer = $object->isForeignRetailer;
156: }
157: if (property_exists($object, 'mcc')) {
158: $this->mcc = $object->mcc;
159: }
160: if (property_exists($object, 'name')) {
161: $this->name = $object->name;
162: }
163: if (property_exists($object, 'phoneNumber')) {
164: $this->phoneNumber = $object->phoneNumber;
165: }
166: if (property_exists($object, 'type')) {
167: $this->type = $object->type;
168: }
169: return $this;
170: }
171: }
172: