commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Cart
ShippingDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Common\BaseAddress
;
12
use
Commercetools\Api\Models\Common\BaseAddressBuilder
;
13
use
Commercetools\Api\Models\Order\DeliveryDraftCollection
;
14
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodReference
;
15
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
17
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
18
use
Commercetools\Base\Builder
;
19
use
Commercetools\Base\DateTimeImmutableCollection
;
20
use
Commercetools\Base\JsonObject
;
21
use
Commercetools\Base\JsonObjectModel
;
22
use
Commercetools\Base\MapperFactory
;
23
use stdClass;
24
28
final
class
ShippingDraftBuilder
implements
Builder
29
{
34
private
$key;
35
40
private
$shippingMethod;
41
46
private
$shippingAddress;
47
52
private
$shippingRateInput;
53
58
private
$externalTaxRate;
59
64
private
$deliveries;
65
70
private
$custom;
71
78
public
function
getKey
()
79
{
80
return
$this->key;
81
}
82
89
public
function
getShippingMethod
()
90
{
91
return
$this->shippingMethod instanceof
ShippingMethodReferenceBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod;
92
}
93
100
public
function
getShippingAddress
()
101
{
102
return
$this->shippingAddress instanceof
BaseAddressBuilder
? $this->shippingAddress->
build
() : $this->shippingAddress;
103
}
104
117
public
function
getShippingRateInput
()
118
{
119
return
$this->shippingRateInput instanceof
ShippingRateInputDraftBuilder
? $this->shippingRateInput->
build
() : $this->shippingRateInput;
120
}
121
128
public
function
getExternalTaxRate
()
129
{
130
return
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate;
131
}
132
139
public
function
getDeliveries
()
140
{
141
return
$this->deliveries;
142
}
143
150
public
function
getCustom
()
151
{
152
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
153
}
154
159
public
function
withKey
(?
string
$key)
160
{
161
$this->key = $key;
162
163
return
$this;
164
}
165
170
public
function
withShippingMethod
(?
ShippingMethodReference
$shippingMethod)
171
{
172
$this->shippingMethod = $shippingMethod;
173
174
return
$this;
175
}
176
181
public
function
withShippingAddress
(?
BaseAddress
$shippingAddress)
182
{
183
$this->shippingAddress = $shippingAddress;
184
185
return
$this;
186
}
187
192
public
function
withShippingRateInput
(?
ShippingRateInputDraft
$shippingRateInput)
193
{
194
$this->shippingRateInput = $shippingRateInput;
195
196
return
$this;
197
}
198
203
public
function
withExternalTaxRate
(?
ExternalTaxRateDraft
$externalTaxRate)
204
{
205
$this->externalTaxRate = $externalTaxRate;
206
207
return
$this;
208
}
209
214
public
function
withDeliveries
(?
DeliveryDraftCollection
$deliveries)
215
{
216
$this->deliveries = $deliveries;
217
218
return
$this;
219
}
220
225
public
function
withCustom
(?
CustomFieldsDraft
$custom)
226
{
227
$this->custom = $custom;
228
229
return
$this;
230
}
231
236
public
function
withShippingMethodBuilder
(?
ShippingMethodReferenceBuilder
$shippingMethod)
237
{
238
$this->shippingMethod = $shippingMethod;
239
240
return
$this;
241
}
242
247
public
function
withShippingAddressBuilder
(?
BaseAddressBuilder
$shippingAddress)
248
{
249
$this->shippingAddress = $shippingAddress;
250
251
return
$this;
252
}
253
258
public
function
withShippingRateInputBuilder
(?
ShippingRateInputDraftBuilder
$shippingRateInput)
259
{
260
$this->shippingRateInput = $shippingRateInput;
261
262
return
$this;
263
}
264
269
public
function
withExternalTaxRateBuilder
(?
ExternalTaxRateDraftBuilder
$externalTaxRate)
270
{
271
$this->externalTaxRate = $externalTaxRate;
272
273
return
$this;
274
}
275
280
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
281
{
282
$this->custom = $custom;
283
284
return
$this;
285
}
286
287
public
function
build
():
ShippingDraft
288
{
289
return
new
ShippingDraftModel
(
290
$this->key,
291
$this->shippingMethod instanceof
ShippingMethodReferenceBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod,
292
$this->shippingAddress instanceof
BaseAddressBuilder
? $this->shippingAddress->
build
() : $this->shippingAddress,
293
$this->shippingRateInput instanceof
ShippingRateInputDraftBuilder
? $this->shippingRateInput->
build
() : $this->shippingRateInput,
294
$this->externalTaxRate instanceof
ExternalTaxRateDraftBuilder
? $this->externalTaxRate->
build
() : $this->externalTaxRate,
295
$this->deliveries,
296
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
297
);
298
}
299
300
public
static
function
of
():
ShippingDraftBuilder
301
{
302
return
new
self
();
303
}
304
}
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder
Definition
ExternalTaxRateDraftBuilder.php:23
Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder\build
build()
Definition
ExternalTaxRateDraftBuilder.php:201
Commercetools\Api\Models\Cart\ShippingDraftBuilder
Definition
ShippingDraftBuilder.php:29
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getExternalTaxRate
getExternalTaxRate()
Definition
ShippingDraftBuilder.php:128
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withExternalTaxRateBuilder
withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate)
Definition
ShippingDraftBuilder.php:269
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getShippingAddress
getShippingAddress()
Definition
ShippingDraftBuilder.php:100
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withExternalTaxRate
withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
Definition
ShippingDraftBuilder.php:203
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getCustom
getCustom()
Definition
ShippingDraftBuilder.php:150
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
ShippingDraftBuilder.php:280
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withShippingMethodBuilder
withShippingMethodBuilder(?ShippingMethodReferenceBuilder $shippingMethod)
Definition
ShippingDraftBuilder.php:236
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withShippingRateInput
withShippingRateInput(?ShippingRateInputDraft $shippingRateInput)
Definition
ShippingDraftBuilder.php:192
Commercetools\Api\Models\Cart\ShippingDraftBuilder\build
build()
Definition
ShippingDraftBuilder.php:287
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withShippingRateInputBuilder
withShippingRateInputBuilder(?ShippingRateInputDraftBuilder $shippingRateInput)
Definition
ShippingDraftBuilder.php:258
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withShippingAddress
withShippingAddress(?BaseAddress $shippingAddress)
Definition
ShippingDraftBuilder.php:181
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getDeliveries
getDeliveries()
Definition
ShippingDraftBuilder.php:139
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withShippingAddressBuilder
withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress)
Definition
ShippingDraftBuilder.php:247
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getShippingMethod
getShippingMethod()
Definition
ShippingDraftBuilder.php:89
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withDeliveries
withDeliveries(?DeliveryDraftCollection $deliveries)
Definition
ShippingDraftBuilder.php:214
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withShippingMethod
withShippingMethod(?ShippingMethodReference $shippingMethod)
Definition
ShippingDraftBuilder.php:170
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getShippingRateInput
getShippingRateInput()
Definition
ShippingDraftBuilder.php:117
Commercetools\Api\Models\Cart\ShippingDraftBuilder\getKey
getKey()
Definition
ShippingDraftBuilder.php:78
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withKey
withKey(?string $key)
Definition
ShippingDraftBuilder.php:159
Commercetools\Api\Models\Cart\ShippingDraftBuilder\of
static of()
Definition
ShippingDraftBuilder.php:300
Commercetools\Api\Models\Cart\ShippingDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
ShippingDraftBuilder.php:225
Commercetools\Api\Models\Cart\ShippingDraftModel
Definition
ShippingDraftModel.php:28
Commercetools\Api\Models\Cart\ShippingRateInputDraftBuilder
Definition
ShippingRateInputDraftBuilder.php:22
Commercetools\Api\Models\Cart\ShippingRateInputDraftBuilder\build
build()
Definition
ShippingRateInputDraftBuilder.php:23
Commercetools\Api\Models\Common\BaseAddressBuilder
Definition
BaseAddressBuilder.php:22
Commercetools\Api\Models\Common\BaseAddressBuilder\build
build()
Definition
BaseAddressBuilder.php:726
Commercetools\Api\Models\Order\DeliveryDraftCollection
Definition
DeliveryDraftCollection.php:22
Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder
Definition
ShippingMethodReferenceBuilder.php:24
Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder\build
build()
Definition
ShippingMethodReferenceBuilder.php:92
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Cart\ExternalTaxRateDraft
Definition
ExternalTaxRateDraft.php:16
Commercetools\Api\Models\Cart\ShippingDraft
Definition
ShippingDraft.php:19
Commercetools\Api\Models\Cart\ShippingRateInputDraft
Definition
ShippingRateInputDraft.php:15
Commercetools\Api\Models\Common\BaseAddress
Definition
BaseAddress.php:15
Commercetools\Api\Models\ShippingMethod\ShippingMethodReference
Definition
ShippingMethodReference.php:16
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition
Cart.php:9
Generated by
1.9.8