commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DivisionDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
20 use stdClass;
21 
25 final class DivisionDraftBuilder implements Builder
26 {
31  private $key;
32 
37  private $status;
38 
43  private $stores;
44 
49  private $storeMode;
50 
55  private $name;
56 
61  private $contactEmail;
62 
67  private $associateMode;
68 
73  private $associates;
74 
79  private $approvalRuleMode;
80 
85  private $addresses;
86 
91  private $shippingAddresses;
92 
97  private $defaultShippingAddress;
98 
103  private $billingAddresses;
104 
109  private $defaultBillingAddress;
110 
115  private $custom;
116 
121  private $parentUnit;
122 
129  public function getKey()
130  {
131  return $this->key;
132  }
133 
140  public function getStatus()
141  {
142  return $this->status;
143  }
144 
154  public function getStores()
155  {
156  return $this->stores;
157  }
158 
166  public function getStoreMode()
167  {
168  return $this->storeMode;
169  }
170 
177  public function getName()
178  {
179  return $this->name;
180  }
181 
188  public function getContactEmail()
189  {
190  return $this->contactEmail;
191  }
192 
199  public function getAssociateMode()
200  {
201  return $this->associateMode;
202  }
203 
210  public function getAssociates()
211  {
212  return $this->associates;
213  }
214 
221  public function getApprovalRuleMode()
222  {
223  return $this->approvalRuleMode;
224  }
225 
232  public function getAddresses()
233  {
234  return $this->addresses;
235  }
236 
244  public function getShippingAddresses()
245  {
246  return $this->shippingAddresses;
247  }
248 
255  public function getDefaultShippingAddress()
256  {
257  return $this->defaultShippingAddress;
258  }
259 
267  public function getBillingAddresses()
268  {
269  return $this->billingAddresses;
270  }
271 
278  public function getDefaultBillingAddress()
279  {
280  return $this->defaultBillingAddress;
281  }
282 
289  public function getCustom()
290  {
291  return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
292  }
293 
300  public function getParentUnit()
301  {
302  return $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit;
303  }
304 
309  public function withKey(?string $key)
310  {
311  $this->key = $key;
312 
313  return $this;
314  }
315 
320  public function withStatus(?string $status)
321  {
322  $this->status = $status;
323 
324  return $this;
325  }
326 
332  {
333  $this->stores = $stores;
334 
335  return $this;
336  }
337 
342  public function withStoreMode(?string $storeMode)
343  {
344  $this->storeMode = $storeMode;
345 
346  return $this;
347  }
348 
353  public function withName(?string $name)
354  {
355  $this->name = $name;
356 
357  return $this;
358  }
359 
364  public function withContactEmail(?string $contactEmail)
365  {
366  $this->contactEmail = $contactEmail;
367 
368  return $this;
369  }
370 
375  public function withAssociateMode(?string $associateMode)
376  {
377  $this->associateMode = $associateMode;
378 
379  return $this;
380  }
381 
386  public function withAssociates(?AssociateDraftCollection $associates)
387  {
388  $this->associates = $associates;
389 
390  return $this;
391  }
392 
397  public function withApprovalRuleMode(?string $approvalRuleMode)
398  {
399  $this->approvalRuleMode = $approvalRuleMode;
400 
401  return $this;
402  }
403 
408  public function withAddresses(?BaseAddressCollection $addresses)
409  {
410  $this->addresses = $addresses;
411 
412  return $this;
413  }
414 
419  public function withShippingAddresses(?array $shippingAddresses)
420  {
421  $this->shippingAddresses = $shippingAddresses;
422 
423  return $this;
424  }
425 
430  public function withDefaultShippingAddress(?int $defaultShippingAddress)
431  {
432  $this->defaultShippingAddress = $defaultShippingAddress;
433 
434  return $this;
435  }
436 
441  public function withBillingAddresses(?array $billingAddresses)
442  {
443  $this->billingAddresses = $billingAddresses;
444 
445  return $this;
446  }
447 
452  public function withDefaultBillingAddress(?int $defaultBillingAddress)
453  {
454  $this->defaultBillingAddress = $defaultBillingAddress;
455 
456  return $this;
457  }
458 
463  public function withCustom(?CustomFieldsDraft $custom)
464  {
465  $this->custom = $custom;
466 
467  return $this;
468  }
469 
474  public function withParentUnit(?BusinessUnitResourceIdentifier $parentUnit)
475  {
476  $this->parentUnit = $parentUnit;
477 
478  return $this;
479  }
480 
485  public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
486  {
487  $this->custom = $custom;
488 
489  return $this;
490  }
491 
497  {
498  $this->parentUnit = $parentUnit;
499 
500  return $this;
501  }
502 
503  public function build(): DivisionDraft
504  {
505  return new DivisionDraftModel(
506  $this->key,
507  $this->status,
508  $this->stores,
509  $this->storeMode,
510  $this->name,
511  $this->contactEmail,
512  $this->associateMode,
513  $this->associates,
514  $this->approvalRuleMode,
515  $this->addresses,
516  $this->shippingAddresses,
517  $this->defaultShippingAddress,
518  $this->billingAddresses,
519  $this->defaultBillingAddress,
520  $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
521  $this->parentUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->parentUnit->build() : $this->parentUnit
522  );
523  }
524 
525  public static function of(): DivisionDraftBuilder
526  {
527  return new self();
528  }
529 }
withStores(?StoreResourceIdentifierCollection $stores)
withParentUnit(?BusinessUnitResourceIdentifier $parentUnit)
withParentUnitBuilder(?BusinessUnitResourceIdentifierBuilder $parentUnit)