commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CompanyDraftModel.php
1<?php
2
3declare(strict_types=1);
10
20use stdClass;
21
25final class CompanyDraftModel extends JsonObjectModel implements CompanyDraft
26{
27 public const DISCRIMINATOR_VALUE = 'Company';
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
130
134 public function __construct(
135 ?string $key = null,
136 ?string $status = null,
138 ?string $storeMode = null,
139 ?string $name = null,
140 ?string $contactEmail = null,
141 ?string $associateMode = null,
143 ?string $approvalRuleMode = null,
145 ?array $shippingAddresses = null,
146 ?int $defaultShippingAddress = null,
147 ?array $billingAddresses = null,
148 ?int $defaultBillingAddress = null,
151 ?string $unitType = null
152 ) {
153 $this->key = $key;
154 $this->status = $status;
155 $this->stores = $stores;
156 $this->storeMode = $storeMode;
157 $this->name = $name;
158 $this->contactEmail = $contactEmail;
159 $this->associateMode = $associateMode;
160 $this->associates = $associates;
161 $this->approvalRuleMode = $approvalRuleMode;
162 $this->addresses = $addresses;
163 $this->shippingAddresses = $shippingAddresses;
164 $this->defaultShippingAddress = $defaultShippingAddress;
165 $this->billingAddresses = $billingAddresses;
166 $this->defaultBillingAddress = $defaultBillingAddress;
167 $this->custom = $custom;
168 $this->customerGroupAssignments = $customerGroupAssignments;
169 $this->unitType = $unitType ?? self::DISCRIMINATOR_VALUE;
170 }
171
178 public function getKey()
179 {
180 if (is_null($this->key)) {
182 $data = $this->raw(self::FIELD_KEY);
183 if (is_null($data)) {
184 return null;
185 }
186 $this->key = (string) $data;
187 }
188
189 return $this->key;
190 }
191
198 public function getStatus()
199 {
200 if (is_null($this->status)) {
202 $data = $this->raw(self::FIELD_STATUS);
203 if (is_null($data)) {
204 return null;
205 }
206 $this->status = (string) $data;
207 }
208
209 return $this->status;
210 }
211
221 public function getStores()
222 {
223 if (is_null($this->stores)) {
225 $data = $this->raw(self::FIELD_STORES);
226 if (is_null($data)) {
227 return null;
228 }
229 $this->stores = StoreResourceIdentifierCollection::fromArray($data);
230 }
231
232 return $this->stores;
233 }
234
242 public function getStoreMode()
243 {
244 if (is_null($this->storeMode)) {
246 $data = $this->raw(self::FIELD_STORE_MODE);
247 if (is_null($data)) {
248 return null;
249 }
250 $this->storeMode = (string) $data;
251 }
252
253 return $this->storeMode;
254 }
255
262 public function getUnitType()
263 {
264 if (is_null($this->unitType)) {
266 $data = $this->raw(self::FIELD_UNIT_TYPE);
267 if (is_null($data)) {
268 return null;
269 }
270 $this->unitType = (string) $data;
271 }
272
273 return $this->unitType;
274 }
275
282 public function getName()
283 {
284 if (is_null($this->name)) {
286 $data = $this->raw(self::FIELD_NAME);
287 if (is_null($data)) {
288 return null;
289 }
290 $this->name = (string) $data;
291 }
292
293 return $this->name;
294 }
295
302 public function getContactEmail()
303 {
304 if (is_null($this->contactEmail)) {
306 $data = $this->raw(self::FIELD_CONTACT_EMAIL);
307 if (is_null($data)) {
308 return null;
309 }
310 $this->contactEmail = (string) $data;
311 }
312
313 return $this->contactEmail;
314 }
315
323 public function getAssociateMode()
324 {
325 if (is_null($this->associateMode)) {
327 $data = $this->raw(self::FIELD_ASSOCIATE_MODE);
328 if (is_null($data)) {
329 return null;
330 }
331 $this->associateMode = (string) $data;
332 }
333
335 }
336
343 public function getAssociates()
344 {
345 if (is_null($this->associates)) {
347 $data = $this->raw(self::FIELD_ASSOCIATES);
348 if (is_null($data)) {
349 return null;
350 }
351 $this->associates = AssociateDraftCollection::fromArray($data);
352 }
353
354 return $this->associates;
355 }
356
365 public function getApprovalRuleMode()
366 {
367 if (is_null($this->approvalRuleMode)) {
369 $data = $this->raw(self::FIELD_APPROVAL_RULE_MODE);
370 if (is_null($data)) {
371 return null;
372 }
373 $this->approvalRuleMode = (string) $data;
374 }
375
377 }
378
385 public function getAddresses()
386 {
387 if (is_null($this->addresses)) {
389 $data = $this->raw(self::FIELD_ADDRESSES);
390 if (is_null($data)) {
391 return null;
392 }
393 $this->addresses = BaseAddressCollection::fromArray($data);
394 }
395
396 return $this->addresses;
397 }
398
406 public function getShippingAddresses()
407 {
408 if (is_null($this->shippingAddresses)) {
410 $data = $this->raw(self::FIELD_SHIPPING_ADDRESSES);
411 if (is_null($data)) {
412 return null;
413 }
414 $this->shippingAddresses = $data;
415 }
416
418 }
419
427 {
428 if (is_null($this->defaultShippingAddress)) {
430 $data = $this->raw(self::FIELD_DEFAULT_SHIPPING_ADDRESS);
431 if (is_null($data)) {
432 return null;
433 }
434 $this->defaultShippingAddress = (int) $data;
435 }
436
438 }
439
447 public function getBillingAddresses()
448 {
449 if (is_null($this->billingAddresses)) {
451 $data = $this->raw(self::FIELD_BILLING_ADDRESSES);
452 if (is_null($data)) {
453 return null;
454 }
455 $this->billingAddresses = $data;
456 }
457
459 }
460
467 public function getDefaultBillingAddress()
468 {
469 if (is_null($this->defaultBillingAddress)) {
471 $data = $this->raw(self::FIELD_DEFAULT_BILLING_ADDRESS);
472 if (is_null($data)) {
473 return null;
474 }
475 $this->defaultBillingAddress = (int) $data;
476 }
477
479 }
480
487 public function getCustom()
488 {
489 if (is_null($this->custom)) {
491 $data = $this->raw(self::FIELD_CUSTOM);
492 if (is_null($data)) {
493 return null;
494 }
495
496 $this->custom = CustomFieldsDraftModel::of($data);
497 }
498
499 return $this->custom;
500 }
501
510 {
511 if (is_null($this->customerGroupAssignments)) {
513 $data = $this->raw(self::FIELD_CUSTOMER_GROUP_ASSIGNMENTS);
514 if (is_null($data)) {
515 return null;
516 }
517 $this->customerGroupAssignments = CustomerGroupAssignmentDraftCollection::fromArray($data);
518 }
519
521 }
522
523
527 public function setKey(?string $key): void
528 {
529 $this->key = $key;
530 }
531
535 public function setStatus(?string $status): void
536 {
537 $this->status = $status;
538 }
539
544 {
545 $this->stores = $stores;
546 }
547
551 public function setStoreMode(?string $storeMode): void
552 {
553 $this->storeMode = $storeMode;
554 }
555
559 public function setName(?string $name): void
560 {
561 $this->name = $name;
562 }
563
567 public function setContactEmail(?string $contactEmail): void
568 {
569 $this->contactEmail = $contactEmail;
570 }
571
575 public function setAssociateMode(?string $associateMode): void
576 {
577 $this->associateMode = $associateMode;
578 }
579
584 {
585 $this->associates = $associates;
586 }
587
591 public function setApprovalRuleMode(?string $approvalRuleMode): void
592 {
593 $this->approvalRuleMode = $approvalRuleMode;
594 }
595
600 {
601 $this->addresses = $addresses;
602 }
603
607 public function setShippingAddresses(?array $shippingAddresses): void
608 {
609 $this->shippingAddresses = $shippingAddresses;
610 }
611
616 {
617 $this->defaultShippingAddress = $defaultShippingAddress;
618 }
619
623 public function setBillingAddresses(?array $billingAddresses): void
624 {
625 $this->billingAddresses = $billingAddresses;
626 }
627
632 {
633 $this->defaultBillingAddress = $defaultBillingAddress;
634 }
635
639 public function setCustom(?CustomFieldsDraft $custom): void
640 {
641 $this->custom = $custom;
642 }
643
648 {
649 $this->customerGroupAssignments = $customerGroupAssignments;
650 }
651}
setCustomerGroupAssignments(?CustomerGroupAssignmentDraftCollection $customerGroupAssignments)
setStores(?StoreResourceIdentifierCollection $stores)
setAssociates(?AssociateDraftCollection $associates)
__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, ?string $unitType=null)
static fromArray(array $data)