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
ShippingInfoBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Common\CentPrecisionMoney
;
12
use
Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder
;
13
use
Commercetools\Api\Models\Order\DeliveryCollection
;
14
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodReference
;
15
use
Commercetools\Api\Models\ShippingMethod\ShippingMethodReferenceBuilder
;
16
use
Commercetools\Api\Models\ShippingMethod\ShippingRate
;
17
use
Commercetools\Api\Models\ShippingMethod\ShippingRateBuilder
;
18
use
Commercetools\Api\Models\TaxCategory\TaxCategoryReference
;
19
use
Commercetools\Api\Models\TaxCategory\TaxCategoryReferenceBuilder
;
20
use
Commercetools\Api\Models\TaxCategory\TaxRate
;
21
use
Commercetools\Api\Models\TaxCategory\TaxRateBuilder
;
22
use
Commercetools\Base\Builder
;
23
use
Commercetools\Base\DateTimeImmutableCollection
;
24
use
Commercetools\Base\JsonObject
;
25
use
Commercetools\Base\JsonObjectModel
;
26
use
Commercetools\Base\MapperFactory
;
27
use stdClass;
28
32
final
class
ShippingInfoBuilder
implements
Builder
33
{
38
private
$shippingMethodName;
39
44
private
$price;
45
50
private
$shippingRate;
51
56
private
$taxedPrice;
57
62
private
$taxRate;
63
68
private
$taxCategory;
69
74
private
$shippingMethod;
75
80
private
$deliveries;
81
86
private
$discountedPrice;
87
92
private
$shippingMethodState;
93
100
public
function
getShippingMethodName
()
101
{
102
return
$this->shippingMethodName;
103
}
104
111
public
function
getPrice
()
112
{
113
return
$this->price instanceof
CentPrecisionMoneyBuilder
? $this->price->
build
() : $this->price;
114
}
115
122
public
function
getShippingRate
()
123
{
124
return
$this->shippingRate instanceof
ShippingRateBuilder
? $this->shippingRate->
build
() : $this->shippingRate;
125
}
126
133
public
function
getTaxedPrice
()
134
{
135
return
$this->taxedPrice instanceof
TaxedItemPriceBuilder
? $this->taxedPrice->
build
() : $this->taxedPrice;
136
}
137
145
public
function
getTaxRate
()
146
{
147
return
$this->taxRate instanceof
TaxRateBuilder
? $this->taxRate->
build
() : $this->taxRate;
148
}
149
156
public
function
getTaxCategory
()
157
{
158
return
$this->taxCategory instanceof
TaxCategoryReferenceBuilder
? $this->taxCategory->
build
() : $this->taxCategory;
159
}
160
167
public
function
getShippingMethod
()
168
{
169
return
$this->shippingMethod instanceof
ShippingMethodReferenceBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod;
170
}
171
178
public
function
getDeliveries
()
179
{
180
return
$this->deliveries;
181
}
182
189
public
function
getDiscountedPrice
()
190
{
191
return
$this->discountedPrice instanceof
DiscountedLineItemPriceBuilder
? $this->discountedPrice->
build
() : $this->discountedPrice;
192
}
193
200
public
function
getShippingMethodState
()
201
{
202
return
$this->shippingMethodState;
203
}
204
209
public
function
withShippingMethodName
(?
string
$shippingMethodName)
210
{
211
$this->shippingMethodName = $shippingMethodName;
212
213
return
$this;
214
}
215
220
public
function
withPrice
(?
CentPrecisionMoney
$price)
221
{
222
$this->price = $price;
223
224
return
$this;
225
}
226
231
public
function
withShippingRate
(?
ShippingRate
$shippingRate)
232
{
233
$this->shippingRate = $shippingRate;
234
235
return
$this;
236
}
237
242
public
function
withTaxedPrice
(?
TaxedItemPrice
$taxedPrice)
243
{
244
$this->taxedPrice = $taxedPrice;
245
246
return
$this;
247
}
248
253
public
function
withTaxRate
(?
TaxRate
$taxRate)
254
{
255
$this->taxRate = $taxRate;
256
257
return
$this;
258
}
259
264
public
function
withTaxCategory
(?
TaxCategoryReference
$taxCategory)
265
{
266
$this->taxCategory = $taxCategory;
267
268
return
$this;
269
}
270
275
public
function
withShippingMethod
(?
ShippingMethodReference
$shippingMethod)
276
{
277
$this->shippingMethod = $shippingMethod;
278
279
return
$this;
280
}
281
286
public
function
withDeliveries
(?
DeliveryCollection
$deliveries)
287
{
288
$this->deliveries = $deliveries;
289
290
return
$this;
291
}
292
297
public
function
withDiscountedPrice
(?
DiscountedLineItemPrice
$discountedPrice)
298
{
299
$this->discountedPrice = $discountedPrice;
300
301
return
$this;
302
}
303
308
public
function
withShippingMethodState
(?
string
$shippingMethodState)
309
{
310
$this->shippingMethodState = $shippingMethodState;
311
312
return
$this;
313
}
314
319
public
function
withPriceBuilder
(?
CentPrecisionMoneyBuilder
$price)
320
{
321
$this->price = $price;
322
323
return
$this;
324
}
325
330
public
function
withShippingRateBuilder
(?
ShippingRateBuilder
$shippingRate)
331
{
332
$this->shippingRate = $shippingRate;
333
334
return
$this;
335
}
336
341
public
function
withTaxedPriceBuilder
(?
TaxedItemPriceBuilder
$taxedPrice)
342
{
343
$this->taxedPrice = $taxedPrice;
344
345
return
$this;
346
}
347
352
public
function
withTaxRateBuilder
(?
TaxRateBuilder
$taxRate)
353
{
354
$this->taxRate = $taxRate;
355
356
return
$this;
357
}
358
363
public
function
withTaxCategoryBuilder
(?
TaxCategoryReferenceBuilder
$taxCategory)
364
{
365
$this->taxCategory = $taxCategory;
366
367
return
$this;
368
}
369
374
public
function
withShippingMethodBuilder
(?
ShippingMethodReferenceBuilder
$shippingMethod)
375
{
376
$this->shippingMethod = $shippingMethod;
377
378
return
$this;
379
}
380
385
public
function
withDiscountedPriceBuilder
(?
DiscountedLineItemPriceBuilder
$discountedPrice)
386
{
387
$this->discountedPrice = $discountedPrice;
388
389
return
$this;
390
}
391
392
public
function
build
():
ShippingInfo
393
{
394
return
new
ShippingInfoModel
(
395
$this->shippingMethodName,
396
$this->price instanceof
CentPrecisionMoneyBuilder
? $this->price->
build
() : $this->price,
397
$this->shippingRate instanceof
ShippingRateBuilder
? $this->shippingRate->
build
() : $this->shippingRate,
398
$this->taxedPrice instanceof
TaxedItemPriceBuilder
? $this->taxedPrice->
build
() : $this->taxedPrice,
399
$this->taxRate instanceof
TaxRateBuilder
? $this->taxRate->
build
() : $this->taxRate,
400
$this->taxCategory instanceof
TaxCategoryReferenceBuilder
? $this->taxCategory->
build
() : $this->taxCategory,
401
$this->shippingMethod instanceof
ShippingMethodReferenceBuilder
? $this->shippingMethod->
build
() : $this->shippingMethod,
402
$this->deliveries,
403
$this->discountedPrice instanceof
DiscountedLineItemPriceBuilder
? $this->discountedPrice->
build
() : $this->discountedPrice,
404
$this->shippingMethodState
405
);
406
}
407
408
public
static
function
of
():
ShippingInfoBuilder
409
{
410
return
new
self
();
411
}
412
}
Commercetools\Api\Models\Cart\DiscountedLineItemPriceBuilder
Definition
DiscountedLineItemPriceBuilder.php:24
Commercetools\Api\Models\Cart\DiscountedLineItemPriceBuilder\build
build()
Definition
DiscountedLineItemPriceBuilder.php:92
Commercetools\Api\Models\Cart\ShippingInfoBuilder
Definition
ShippingInfoBuilder.php:33
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withPrice
withPrice(?CentPrecisionMoney $price)
Definition
ShippingInfoBuilder.php:220
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getTaxCategory
getTaxCategory()
Definition
ShippingInfoBuilder.php:156
Commercetools\Api\Models\Cart\ShippingInfoBuilder\build
build()
Definition
ShippingInfoBuilder.php:392
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getDiscountedPrice
getDiscountedPrice()
Definition
ShippingInfoBuilder.php:189
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withShippingMethodState
withShippingMethodState(?string $shippingMethodState)
Definition
ShippingInfoBuilder.php:308
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withDiscountedPrice
withDiscountedPrice(?DiscountedLineItemPrice $discountedPrice)
Definition
ShippingInfoBuilder.php:297
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withTaxRate
withTaxRate(?TaxRate $taxRate)
Definition
ShippingInfoBuilder.php:253
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getShippingRate
getShippingRate()
Definition
ShippingInfoBuilder.php:122
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withTaxedPriceBuilder
withTaxedPriceBuilder(?TaxedItemPriceBuilder $taxedPrice)
Definition
ShippingInfoBuilder.php:341
Commercetools\Api\Models\Cart\ShippingInfoBuilder\of
static of()
Definition
ShippingInfoBuilder.php:408
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withDiscountedPriceBuilder
withDiscountedPriceBuilder(?DiscountedLineItemPriceBuilder $discountedPrice)
Definition
ShippingInfoBuilder.php:385
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withTaxCategoryBuilder
withTaxCategoryBuilder(?TaxCategoryReferenceBuilder $taxCategory)
Definition
ShippingInfoBuilder.php:363
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withTaxRateBuilder
withTaxRateBuilder(?TaxRateBuilder $taxRate)
Definition
ShippingInfoBuilder.php:352
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withShippingMethodName
withShippingMethodName(?string $shippingMethodName)
Definition
ShippingInfoBuilder.php:209
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getShippingMethodState
getShippingMethodState()
Definition
ShippingInfoBuilder.php:200
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withShippingRateBuilder
withShippingRateBuilder(?ShippingRateBuilder $shippingRate)
Definition
ShippingInfoBuilder.php:330
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getShippingMethodName
getShippingMethodName()
Definition
ShippingInfoBuilder.php:100
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withTaxCategory
withTaxCategory(?TaxCategoryReference $taxCategory)
Definition
ShippingInfoBuilder.php:264
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withShippingRate
withShippingRate(?ShippingRate $shippingRate)
Definition
ShippingInfoBuilder.php:231
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withShippingMethod
withShippingMethod(?ShippingMethodReference $shippingMethod)
Definition
ShippingInfoBuilder.php:275
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getDeliveries
getDeliveries()
Definition
ShippingInfoBuilder.php:178
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getTaxRate
getTaxRate()
Definition
ShippingInfoBuilder.php:145
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withTaxedPrice
withTaxedPrice(?TaxedItemPrice $taxedPrice)
Definition
ShippingInfoBuilder.php:242
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withDeliveries
withDeliveries(?DeliveryCollection $deliveries)
Definition
ShippingInfoBuilder.php:286
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getTaxedPrice
getTaxedPrice()
Definition
ShippingInfoBuilder.php:133
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getPrice
getPrice()
Definition
ShippingInfoBuilder.php:111
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withPriceBuilder
withPriceBuilder(?CentPrecisionMoneyBuilder $price)
Definition
ShippingInfoBuilder.php:319
Commercetools\Api\Models\Cart\ShippingInfoBuilder\getShippingMethod
getShippingMethod()
Definition
ShippingInfoBuilder.php:167
Commercetools\Api\Models\Cart\ShippingInfoBuilder\withShippingMethodBuilder
withShippingMethodBuilder(?ShippingMethodReferenceBuilder $shippingMethod)
Definition
ShippingInfoBuilder.php:374
Commercetools\Api\Models\Cart\ShippingInfoModel
Definition
ShippingInfoModel.php:32
Commercetools\Api\Models\Cart\TaxedItemPriceBuilder
Definition
TaxedItemPriceBuilder.php:24
Commercetools\Api\Models\Cart\TaxedItemPriceBuilder\build
build()
Definition
TaxedItemPriceBuilder.php:172
Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder
Definition
CentPrecisionMoneyBuilder.php:22
Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder\build
build()
Definition
CentPrecisionMoneyBuilder.php:112
Commercetools\Api\Models\Order\DeliveryCollection
Definition
DeliveryCollection.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\ShippingMethod\ShippingRateBuilder
Definition
ShippingRateBuilder.php:24
Commercetools\Api\Models\ShippingMethod\ShippingRateBuilder\build
build()
Definition
ShippingRateBuilder.php:161
Commercetools\Api\Models\TaxCategory\TaxCategoryReferenceBuilder
Definition
TaxCategoryReferenceBuilder.php:24
Commercetools\Api\Models\TaxCategory\TaxCategoryReferenceBuilder\build
build()
Definition
TaxCategoryReferenceBuilder.php:92
Commercetools\Api\Models\TaxCategory\TaxRateBuilder
Definition
TaxRateBuilder.php:22
Commercetools\Api\Models\TaxCategory\TaxRateBuilder\build
build()
Definition
TaxRateBuilder.php:251
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\DiscountedLineItemPrice
Definition
DiscountedLineItemPrice.php:16
Commercetools\Api\Models\Cart\ShippingInfo
Definition
ShippingInfo.php:21
Commercetools\Api\Models\Cart\TaxedItemPrice
Definition
TaxedItemPrice.php:16
Commercetools\Api\Models\Common\CentPrecisionMoney
Definition
CentPrecisionMoney.php:15
Commercetools\Api\Models\ShippingMethod\ShippingMethodReference
Definition
ShippingMethodReference.php:16
Commercetools\Api\Models\ShippingMethod\ShippingRate
Definition
ShippingRate.php:16
Commercetools\Api\Models\TaxCategory\TaxCategoryReference
Definition
TaxCategoryReference.php:16
Commercetools\Api\Models\TaxCategory\TaxRate
Definition
TaxRate.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