commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DivisionDraftModel.php
1<?php
2
3declare(strict_types=1);
10
20use stdClass;
21
25final class DivisionDraftModel extends JsonObjectModel implements DivisionDraft
26{
27 public const DISCRIMINATOR_VALUE = 'Division';
32 protected $key;
33
38 protected $status;
39
44 protected $stores;
45
50 protected $storeMode;
51
56 protected $unitType;
57
62 protected $name;
63
68 protected $contactEmail;
69
74 protected $associateMode;
75
80 protected $associates;
81
87
92 protected $addresses;
93
99
105
111
117
122 protected $custom;
123
129
134 protected $parentUnit;
135
136
140 public function __construct(
141 ?string $key = null,
142 ?string $status = null,
144 ?string $storeMode = null,
145 ?string $name = null,
146 ?string $contactEmail = null,
147 ?string $associateMode = null,
149 ?string $approvalRuleMode = null,
151 ?array $shippingAddresses = null,
152 ?int $defaultShippingAddress = null,
153 ?array $billingAddresses = null,
154 ?int $defaultBillingAddress = null,
158 ?string $unitType = null
159 ) {
160 $this->key = $key;
161 $this->status = $status;
162 $this->stores = $stores;
163 $this->storeMode = $storeMode;
164 $this->name = $name;
165 $this->contactEmail = $contactEmail;
166 $this->associateMode = $associateMode;
167 $this->associates = $associates;
168 $this->approvalRuleMode = $approvalRuleMode;
169 $this->addresses = $addresses;
170 $this->shippingAddresses = $shippingAddresses;
171 $this->defaultShippingAddress = $defaultShippingAddress;
172 $this->billingAddresses = $billingAddresses;
173 $this->defaultBillingAddress = $defaultBillingAddress;
174 $this->custom = $custom;
175 $this->customerGroupAssignments = $customerGroupAssignments;
176 $this->parentUnit = $parentUnit;
177 $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE;
178 }
179
186 public function getKey()
187 {
188 if (is_null($this->key)) {
190 $data = $this->raw(self::FIELD_KEY);
191 if (is_null($data)) {
192 return null;
193 }
194 $this->key = (string) $data;
195 }
196
197 return $this->key;
198 }
199
206 public function getStatus()
207 {
208 if (is_null($this->status)) {
210 $data = $this->raw(self::FIELD_STATUS);
211 if (is_null($data)) {
212 return null;
213 }
214 $this->status = (string) $data;
215 }
216
217 return $this->status;
218 }
219
229 public function getStores()
230 {
231 if (is_null($this->stores)) {
233 $data = $this->raw(self::FIELD_STORES);
234 if (is_null($data)) {
235 return null;
236 }
237 $this->stores = StoreResourceIdentifierCollection::fromArray($data);
238 }
239
240 return $this->stores;
241 }
242
250 public function getStoreMode()
251 {
252 if (is_null($this->storeMode)) {
254 $data = $this->raw(self::FIELD_STORE_MODE);
255 if (is_null($data)) {
256 return null;
257 }
258 $this->storeMode = (string) $data;
259 }
260
261 return $this->storeMode;
262 }
263
270 public function getUnitType()
271 {
272 if (is_null($this->unitType)) {
274 $data = $this->raw(self::FIELD_UNIT_TYPE);
275 if (is_null($data)) {
276 return null;
277 }
278 $this->unitType = (string) $data;
279 }
280
281 return $this->unitType;
282 }
283
290 public function getName()
291 {
292 if (is_null($this->name)) {
294 $data = $this->raw(self::FIELD_NAME);
295 if (is_null($data)) {
296 return null;
297 }
298 $this->name = (string) $data;
299 }
300
301 return $this->name;
302 }
303
310 public function getContactEmail()
311 {
312 if (is_null($this->contactEmail)) {
314 $data = $this->raw(self::FIELD_CONTACT_EMAIL);
315 if (is_null($data)) {
316 return null;
317 }
318 $this->contactEmail = (string) $data;
319 }
320
321 return $this->contactEmail;
322 }
323
330 public function getAssociateMode()
331 {
332 if (is_null($this->associateMode)) {
334 $data = $this->raw(self::FIELD_ASSOCIATE_MODE);
335 if (is_null($data)) {
336 return null;
337 }
338 $this->associateMode = (string) $data;
339 }
340
342 }
343
350 public function getAssociates()
351 {
352 if (is_null($this->associates)) {
354 $data = $this->raw(self::FIELD_ASSOCIATES);
355 if (is_null($data)) {
356 return null;
357 }
358 $this->associates = AssociateDraftCollection::fromArray($data);
359 }
360
361 return $this->associates;
362 }
363
370 public function getApprovalRuleMode()
371 {
372 if (is_null($this->approvalRuleMode)) {
374 $data = $this->raw(self::FIELD_APPROVAL_RULE_MODE);
375 if (is_null($data)) {
376 return null;
377 }
378 $this->approvalRuleMode = (string) $data;
379 }
380
382 }
383
390 public function getAddresses()
391 {
392 if (is_null($this->addresses)) {
394 $data = $this->raw(self::FIELD_ADDRESSES);
395 if (is_null($data)) {
396 return null;
397 }
398 $this->addresses = BaseAddressCollection::fromArray($data);
399 }
400
401 return $this->addresses;
402 }
403
411 public function getShippingAddresses()
412 {
413 if (is_null($this->shippingAddresses)) {
415 $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES);
416 if (is_null($data)) {
417 return null;
418 }
419 $this->shippingAddresses = $data;
420 }
421
423 }
424
432 {
433 if (is_null($this->defaultShippingAddress)) {
435 $data = $this->raw(self::FIELD_DEFAULT_SHIPPING_ADDRESS);
436 if (is_null($data)) {
437 return null;
438 }
439 $this->defaultShippingAddress = (int) $data;
440 }
441
443 }
444
452 public function getBillingAddresses()
453 {
454 if (is_null($this->billingAddresses)) {
456 $data = $this->raw(self::FIELD_BILLING_ADDRESSES);
457 if (is_null($data)) {
458 return null;
459 }
460 $this->billingAddresses = $data;
461 }
462
464 }
465
472 public function getDefaultBillingAddress()
473 {
474 if (is_null($this->defaultBillingAddress)) {
476 $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS);
477 if (is_null($data)) {
478 return null;
479 }
480 $this->defaultBillingAddress = (int) $data;
481 }
482
484 }
485
492 public function getCustom()
493 {
494 if (is_null($this->custom)) {
496 $data = $this->raw(self::FIELD_CUSTOM);
497 if (is_null($data)) {
498 return null;
499 }
500
501 $this->custom = CustomFieldsDraftModel::of($data);
502 }
503
504 return $this->custom;
505 }
506
515 {
516 if (is_null($this->customerGroupAssignments)) {
518 $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS);
519 if (is_null($data)) {
520 return null;
521 }
522 $this->customerGroupAssignments = CustomerGroupAssignmentDraftCollection::fromArray($data);
523 }
524
526 }
527
534 public function getParentUnit()
535 {
536 if (is_null($this->parentUnit)) {
538 $data = $this->raw(self::FIELD_PARENT_UNIT);
539 if (is_null($data)) {
540 return null;
541 }
542
543 $this->parentUnit = BusinessUnitResourceIdentifierModel::of($data);
544 }
545
546 return $this->parentUnit;
547 }
548
549
553 public function setKey(?string $key): void
554 {
555 $this->key = $key;
556 }
557
561 public function setStatus(?string $status): void
562 {
563 $this->status = $status;
564 }
565
570 {
571 $this->stores = $stores;
572 }
573
577 public function setStoreMode(?string $storeMode): void
578 {
579 $this->storeMode = $storeMode;
580 }
581
585 public function setName(?string $name): void
586 {
587 $this->name = $name;
588 }
589
593 public function setContactEmail(?string $contactEmail): void
594 {
595 $this->contactEmail = $contactEmail;
596 }
597
601 public function setAssociateMode(?string $associateMode): void
602 {
603 $this->associateMode = $associateMode;
604 }
605
610 {
611 $this->associates = $associates;
612 }
613
617 public function setApprovalRuleMode(?string $approvalRuleMode): void
618 {
619 $this->approvalRuleMode = $approvalRuleMode;
620 }
621
626 {
627 $this->addresses = $addresses;
628 }
629
633 public function setShippingAddresses(?array $shippingAddresses): void
634 {
635 $this->shippingAddresses = $shippingAddresses;
636 }
637
642 {
643 $this->defaultShippingAddress = $defaultShippingAddress;
644 }
645
649 public function setBillingAddresses(?array $billingAddresses): void
650 {
651 $this->billingAddresses = $billingAddresses;
652 }
653
658 {
659 $this->defaultBillingAddress = $defaultBillingAddress;
660 }
661
665 public function setCustom(?CustomFieldsDraft $custom): void
666 {
667 $this->custom = $custom;
668 }
669
674 {
675 $this->customerGroupAssignments = $customerGroupAssignments;
676 }
677
682 {
683 $this->parentUnit = $parentUnit;
684 }
685}
__construct(?string $key=null, ?string $status=null, ?StoreResourceIdentifierCollection $stores=null, ?string $storeMode=null, ?string $name=null, ?string $contactEmail=null, ?string $associateMode=null, ?AssociateDraftCollection $associates=null, ?string $approvalRuleMode=null, ?BaseAddressCollection $addresses=null, ?array $shippingAddresses=null, ?int $defaultShippingAddress=null, ?array $billingAddresses=null, ?int $defaultBillingAddress=null, ?CustomFieldsDraft $custom=null, ?CustomerGroupAssignmentDraftCollection $customerGroupAssignments=null, ?BusinessUnitResourceIdentifier $parentUnit=null, ?string $unitType=null)
setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
setParentUnit(?BusinessUnitResourceIdentifier $parentUnit)
setStores(?StoreResourceIdentifierCollection $stores)
static fromArray(array $data)