commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DeliveryAddressDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $deliveryId;
30
35 private $address;
36
43 public function getDeliveryId()
44 {
45 return $this->deliveryId;
46 }
47
54 public function getAddress()
55 {
56 return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address;
57 }
58
63 public function withDeliveryId(?string $deliveryId)
64 {
65 $this->deliveryId = $deliveryId;
66
67 return $this;
68 }
69
74 public function withAddress(?Address $address)
75 {
76 $this->address = $address;
77
78 return $this;
79 }
80
85 public function withAddressBuilder(?AddressBuilder $address)
86 {
87 $this->address = $address;
88
89 return $this;
90 }
91
92 public function build(): DeliveryAddressDraft
93 {
95 $this->deliveryId,
96 $this->address instanceof AddressBuilder ? $this->address->build() : $this->address
97 );
98 }
99
100 public static function of(): DeliveryAddressDraftBuilder
101 {
102 return new self();
103 }
104}