commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CompanyDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
20 use stdClass;
21 
25 final class CompanyDraftBuilder 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 
123  public function getKey()
124  {
125  return $this->key;
126  }
127 
134  public function getStatus()
135  {
136  return $this->status;
137  }
138 
148  public function getStores()
149  {
150  return $this->stores;
151  }
152 
160  public function getStoreMode()
161  {
162  return $this->storeMode;
163  }
164 
171  public function getName()
172  {
173  return $this->name;
174  }
175 
182  public function getContactEmail()
183  {
184  return $this->contactEmail;
185  }
186 
194  public function getAssociateMode()
195  {
196  return $this->associateMode;
197  }
198 
205  public function getAssociates()
206  {
207  return $this->associates;
208  }
209 
218  public function getApprovalRuleMode()
219  {
220  return $this->approvalRuleMode;
221  }
222 
229  public function getAddresses()
230  {
231  return $this->addresses;
232  }
233 
241  public function getShippingAddresses()
242  {
243  return $this->shippingAddresses;
244  }
245 
252  public function getDefaultShippingAddress()
253  {
254  return $this->defaultShippingAddress;
255  }
256 
264  public function getBillingAddresses()
265  {
266  return $this->billingAddresses;
267  }
268 
275  public function getDefaultBillingAddress()
276  {
277  return $this->defaultBillingAddress;
278  }
279 
286  public function getCustom()
287  {
288  return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
289  }
290 
295  public function withKey(?string $key)
296  {
297  $this->key = $key;
298 
299  return $this;
300  }
301 
306  public function withStatus(?string $status)
307  {
308  $this->status = $status;
309 
310  return $this;
311  }
312 
318  {
319  $this->stores = $stores;
320 
321  return $this;
322  }
323 
328  public function withStoreMode(?string $storeMode)
329  {
330  $this->storeMode = $storeMode;
331 
332  return $this;
333  }
334 
339  public function withName(?string $name)
340  {
341  $this->name = $name;
342 
343  return $this;
344  }
345 
350  public function withContactEmail(?string $contactEmail)
351  {
352  $this->contactEmail = $contactEmail;
353 
354  return $this;
355  }
356 
361  public function withAssociateMode(?string $associateMode)
362  {
363  $this->associateMode = $associateMode;
364 
365  return $this;
366  }
367 
372  public function withAssociates(?AssociateDraftCollection $associates)
373  {
374  $this->associates = $associates;
375 
376  return $this;
377  }
378 
383  public function withApprovalRuleMode(?string $approvalRuleMode)
384  {
385  $this->approvalRuleMode = $approvalRuleMode;
386 
387  return $this;
388  }
389 
394  public function withAddresses(?BaseAddressCollection $addresses)
395  {
396  $this->addresses = $addresses;
397 
398  return $this;
399  }
400 
405  public function withShippingAddresses(?array $shippingAddresses)
406  {
407  $this->shippingAddresses = $shippingAddresses;
408 
409  return $this;
410  }
411 
416  public function withDefaultShippingAddress(?int $defaultShippingAddress)
417  {
418  $this->defaultShippingAddress = $defaultShippingAddress;
419 
420  return $this;
421  }
422 
427  public function withBillingAddresses(?array $billingAddresses)
428  {
429  $this->billingAddresses = $billingAddresses;
430 
431  return $this;
432  }
433 
438  public function withDefaultBillingAddress(?int $defaultBillingAddress)
439  {
440  $this->defaultBillingAddress = $defaultBillingAddress;
441 
442  return $this;
443  }
444 
449  public function withCustom(?CustomFieldsDraft $custom)
450  {
451  $this->custom = $custom;
452 
453  return $this;
454  }
455 
460  public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
461  {
462  $this->custom = $custom;
463 
464  return $this;
465  }
466 
467  public function build(): CompanyDraft
468  {
469  return new CompanyDraftModel(
470  $this->key,
471  $this->status,
472  $this->stores,
473  $this->storeMode,
474  $this->name,
475  $this->contactEmail,
476  $this->associateMode,
477  $this->associates,
478  $this->approvalRuleMode,
479  $this->addresses,
480  $this->shippingAddresses,
481  $this->defaultShippingAddress,
482  $this->billingAddresses,
483  $this->defaultBillingAddress,
484  $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
485  );
486  }
487 
488  public static function of(): CompanyDraftBuilder
489  {
490  return new self();
491  }
492 }
withStores(?StoreResourceIdentifierCollection $stores)