commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DivisionBusinessUnitImportModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
28 public const DISCRIMINATOR_VALUE = 'Division';
33 protected $unitType;
34
39 protected $key;
40
45 protected $name;
46
51 protected $status;
52
57 protected $contactEmail;
58
63 protected $associates;
64
69 protected $addresses;
70
76
82
88
94
99 protected $stores;
100
105 protected $custom;
106
111 protected $storeMode;
112
117 protected $parentUnit;
118
123 protected $associateMode;
124
130
131
135 public function __construct(
136 ?string $key = null,
137 ?string $name = null,
138 ?string $status = null,
139 ?string $contactEmail = null,
142 ?array $shippingAddresses = null,
143 ?int $defaultShippingAddress = null,
144 ?array $billingAddresses = null,
145 ?int $defaultBillingAddress = null,
147 ?Custom $custom = null,
148 ?string $storeMode = null,
150 ?string $associateMode = null,
151 ?string $approvalRuleMode = null,
152 ?string $unitType = null
153 ) {
154 $this->key = $key;
155 $this->name = $name;
156 $this->status = $status;
157 $this->contactEmail = $contactEmail;
158 $this->associates = $associates;
159 $this->addresses = $addresses;
160 $this->shippingAddresses = $shippingAddresses;
161 $this->defaultShippingAddress = $defaultShippingAddress;
162 $this->billingAddresses = $billingAddresses;
163 $this->defaultBillingAddress = $defaultBillingAddress;
164 $this->stores = $stores;
165 $this->custom = $custom;
166 $this->storeMode = $storeMode;
167 $this->parentUnit = $parentUnit;
168 $this->associateMode = $associateMode;
169 $this->approvalRuleMode = $approvalRuleMode;
170 $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE;
171 }
172
179 public function getUnitType()
180 {
181 if (is_null($this->unitType)) {
183 $data = $this->raw(self::FIELD_UNIT_TYPE);
184 if (is_null($data)) {
185 return null;
186 }
187 $this->unitType = (string) $data;
188 }
189
190 return $this->unitType;
191 }
192
199 public function getKey()
200 {
201 if (is_null($this->key)) {
203 $data = $this->raw(self::FIELD_KEY);
204 if (is_null($data)) {
205 return null;
206 }
207 $this->key = (string) $data;
208 }
209
210 return $this->key;
211 }
212
219 public function getName()
220 {
221 if (is_null($this->name)) {
223 $data = $this->raw(self::FIELD_NAME);
224 if (is_null($data)) {
225 return null;
226 }
227 $this->name = (string) $data;
228 }
229
230 return $this->name;
231 }
232
239 public function getStatus()
240 {
241 if (is_null($this->status)) {
243 $data = $this->raw(self::FIELD_STATUS);
244 if (is_null($data)) {
245 return null;
246 }
247 $this->status = (string) $data;
248 }
249
250 return $this->status;
251 }
252
259 public function getContactEmail()
260 {
261 if (is_null($this->contactEmail)) {
263 $data = $this->raw(self::FIELD_CONTACT_EMAIL);
264 if (is_null($data)) {
265 return null;
266 }
267 $this->contactEmail = (string) $data;
268 }
269
270 return $this->contactEmail;
271 }
272
279 public function getAssociates()
280 {
281 if (is_null($this->associates)) {
283 $data = $this->raw(self::FIELD_ASSOCIATES);
284 if (is_null($data)) {
285 return null;
286 }
287 $this->associates = AssociateDraftCollection::fromArray($data);
288 }
289
290 return $this->associates;
291 }
292
299 public function getAddresses()
300 {
301 if (is_null($this->addresses)) {
303 $data = $this->raw(self::FIELD_ADDRESSES);
304 if (is_null($data)) {
305 return null;
306 }
307 $this->addresses = AddressCollection::fromArray($data);
308 }
309
310 return $this->addresses;
311 }
312
319 public function getShippingAddresses()
320 {
321 if (is_null($this->shippingAddresses)) {
323 $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES);
324 if (is_null($data)) {
325 return null;
326 }
327 $this->shippingAddresses = $data;
328 }
329
331 }
332
340 {
341 if (is_null($this->defaultShippingAddress)) {
343 $data = $this->raw(self::FIELD_DEFAULT_SHIPPING_ADDRESS);
344 if (is_null($data)) {
345 return null;
346 }
347 $this->defaultShippingAddress = (int) $data;
348 }
349
351 }
352
359 public function getBillingAddresses()
360 {
361 if (is_null($this->billingAddresses)) {
363 $data = $this->raw(self::FIELD_BILLING_ADDRESSES);
364 if (is_null($data)) {
365 return null;
366 }
367 $this->billingAddresses = $data;
368 }
369
371 }
372
379 public function getDefaultBillingAddress()
380 {
381 if (is_null($this->defaultBillingAddress)) {
383 $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS);
384 if (is_null($data)) {
385 return null;
386 }
387 $this->defaultBillingAddress = (int) $data;
388 }
389
391 }
392
399 public function getStores()
400 {
401 if (is_null($this->stores)) {
403 $data = $this->raw(self::FIELD_STORES);
404 if (is_null($data)) {
405 return null;
406 }
407 $this->stores = StoreKeyReferenceCollection::fromArray($data);
408 }
409
410 return $this->stores;
411 }
412
419 public function getCustom()
420 {
421 if (is_null($this->custom)) {
423 $data = $this->raw(self::FIELD_CUSTOM);
424 if (is_null($data)) {
425 return null;
426 }
427
428 $this->custom = CustomModel::of($data);
429 }
430
431 return $this->custom;
432 }
433
440 public function getStoreMode()
441 {
442 if (is_null($this->storeMode)) {
444 $data = $this->raw(self::FIELD_STORE_MODE);
445 if (is_null($data)) {
446 return null;
447 }
448 $this->storeMode = (string) $data;
449 }
450
451 return $this->storeMode;
452 }
453
460 public function getParentUnit()
461 {
462 if (is_null($this->parentUnit)) {
464 $data = $this->raw(self::FIELD_PARENT_UNIT);
465 if (is_null($data)) {
466 return null;
467 }
468
469 $this->parentUnit = BusinessUnitKeyReferenceModel::of($data);
470 }
471
472 return $this->parentUnit;
473 }
474
481 public function getAssociateMode()
482 {
483 if (is_null($this->associateMode)) {
485 $data = $this->raw(self::FIELD_ASSOCIATE_MODE);
486 if (is_null($data)) {
487 return null;
488 }
489 $this->associateMode = (string) $data;
490 }
491
493 }
494
501 public function getApprovalRuleMode()
502 {
503 if (is_null($this->approvalRuleMode)) {
505 $data = $this->raw(self::FIELD_APPROVAL_RULE_MODE);
506 if (is_null($data)) {
507 return null;
508 }
509 $this->approvalRuleMode = (string) $data;
510 }
511
513 }
514
515
519 public function setKey(?string $key): void
520 {
521 $this->key = $key;
522 }
523
527 public function setName(?string $name): void
528 {
529 $this->name = $name;
530 }
531
535 public function setStatus(?string $status): void
536 {
537 $this->status = $status;
538 }
539
543 public function setContactEmail(?string $contactEmail): void
544 {
545 $this->contactEmail = $contactEmail;
546 }
547
552 {
553 $this->associates = $associates;
554 }
555
560 {
561 $this->addresses = $addresses;
562 }
563
567 public function setShippingAddresses(?array $shippingAddresses): void
568 {
569 $this->shippingAddresses = $shippingAddresses;
570 }
571
576 {
577 $this->defaultShippingAddress = $defaultShippingAddress;
578 }
579
583 public function setBillingAddresses(?array $billingAddresses): void
584 {
585 $this->billingAddresses = $billingAddresses;
586 }
587
592 {
593 $this->defaultBillingAddress = $defaultBillingAddress;
594 }
595
600 {
601 $this->stores = $stores;
602 }
603
607 public function setCustom(?Custom $custom): void
608 {
609 $this->custom = $custom;
610 }
611
615 public function setStoreMode(?string $storeMode): void
616 {
617 $this->storeMode = $storeMode;
618 }
619
624 {
625 $this->parentUnit = $parentUnit;
626 }
627
631 public function setAssociateMode(?string $associateMode): void
632 {
633 $this->associateMode = $associateMode;
634 }
635
639 public function setApprovalRuleMode(?string $approvalRuleMode): void
640 {
641 $this->approvalRuleMode = $approvalRuleMode;
642 }
643}
__construct(?string $key=null, ?string $name=null, ?string $status=null, ?string $contactEmail=null, ?AssociateDraftCollection $associates=null, ?AddressCollection $addresses=null, ?array $shippingAddresses=null, ?int $defaultShippingAddress=null, ?array $billingAddresses=null, ?int $defaultBillingAddress=null, ?StoreKeyReferenceCollection $stores=null, ?Custom $custom=null, ?string $storeMode=null, ?BusinessUnitKeyReference $parentUnit=null, ?string $associateMode=null, ?string $approvalRuleMode=null, ?string $unitType=null)
static fromArray(array $data)