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
ShippingBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Common\Address
;
12
use
Commercetools\Api\Models\Common\AddressBuilder
;
13
use
Commercetools\Api\Models\Type\CustomFields
;
14
use
Commercetools\Api\Models\Type\CustomFieldsBuilder
;
15
use
Commercetools\Base\Builder
;
16
use
Commercetools\Base\DateTimeImmutableCollection
;
17
use
Commercetools\Base\JsonObject
;
18
use
Commercetools\Base\JsonObjectModel
;
19
use
Commercetools\Base\MapperFactory
;
20
use stdClass;
21
25
final
class
ShippingBuilder
implements
Builder
26
{
31
private
$shippingKey;
32
37
private
$shippingInfo;
38
43
private
$shippingAddress;
44
49
private
$shippingRateInput;
50
55
private
$shippingCustomFields;
56
63
public
function
getShippingKey
()
64
{
65
return
$this->shippingKey;
66
}
67
74
public
function
getShippingInfo
()
75
{
76
return
$this->shippingInfo instanceof
ShippingInfoBuilder
? $this->shippingInfo->
build
() : $this->shippingInfo;
77
}
78
85
public
function
getShippingAddress
()
86
{
87
return
$this->shippingAddress instanceof
AddressBuilder
? $this->shippingAddress->
build
() : $this->shippingAddress;
88
}
89
102
public
function
getShippingRateInput
()
103
{
104
return
$this->shippingRateInput instanceof
ShippingRateInputBuilder
? $this->shippingRateInput->
build
() : $this->shippingRateInput;
105
}
106
113
public
function
getShippingCustomFields
()
114
{
115
return
$this->shippingCustomFields instanceof
CustomFieldsBuilder
? $this->shippingCustomFields->
build
() : $this->shippingCustomFields;
116
}
117
122
public
function
withShippingKey
(?
string
$shippingKey)
123
{
124
$this->shippingKey = $shippingKey;
125
126
return
$this;
127
}
128
133
public
function
withShippingInfo
(?
ShippingInfo
$shippingInfo)
134
{
135
$this->shippingInfo = $shippingInfo;
136
137
return
$this;
138
}
139
144
public
function
withShippingAddress
(?
Address
$shippingAddress)
145
{
146
$this->shippingAddress = $shippingAddress;
147
148
return
$this;
149
}
150
155
public
function
withShippingRateInput
(?
ShippingRateInput
$shippingRateInput)
156
{
157
$this->shippingRateInput = $shippingRateInput;
158
159
return
$this;
160
}
161
166
public
function
withShippingCustomFields
(?
CustomFields
$shippingCustomFields)
167
{
168
$this->shippingCustomFields = $shippingCustomFields;
169
170
return
$this;
171
}
172
177
public
function
withShippingInfoBuilder
(?
ShippingInfoBuilder
$shippingInfo)
178
{
179
$this->shippingInfo = $shippingInfo;
180
181
return
$this;
182
}
183
188
public
function
withShippingAddressBuilder
(?
AddressBuilder
$shippingAddress)
189
{
190
$this->shippingAddress = $shippingAddress;
191
192
return
$this;
193
}
194
199
public
function
withShippingRateInputBuilder
(?
ShippingRateInputBuilder
$shippingRateInput)
200
{
201
$this->shippingRateInput = $shippingRateInput;
202
203
return
$this;
204
}
205
210
public
function
withShippingCustomFieldsBuilder
(?
CustomFieldsBuilder
$shippingCustomFields)
211
{
212
$this->shippingCustomFields = $shippingCustomFields;
213
214
return
$this;
215
}
216
217
public
function
build
():
Shipping
218
{
219
return
new
ShippingModel
(
220
$this->shippingKey,
221
$this->shippingInfo instanceof
ShippingInfoBuilder
? $this->shippingInfo->
build
() : $this->shippingInfo,
222
$this->shippingAddress instanceof
AddressBuilder
? $this->shippingAddress->
build
() : $this->shippingAddress,
223
$this->shippingRateInput instanceof
ShippingRateInputBuilder
? $this->shippingRateInput->
build
() : $this->shippingRateInput,
224
$this->shippingCustomFields instanceof
CustomFieldsBuilder
? $this->shippingCustomFields->
build
() : $this->shippingCustomFields
225
);
226
}
227
228
public
static
function
of
():
ShippingBuilder
229
{
230
return
new
self
();
231
}
232
}
Commercetools\Api\Models\Cart\ShippingBuilder
Definition
ShippingBuilder.php:26
Commercetools\Api\Models\Cart\ShippingBuilder\getShippingKey
getShippingKey()
Definition
ShippingBuilder.php:63
Commercetools\Api\Models\Cart\ShippingBuilder\getShippingInfo
getShippingInfo()
Definition
ShippingBuilder.php:74
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingCustomFields
withShippingCustomFields(?CustomFields $shippingCustomFields)
Definition
ShippingBuilder.php:166
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingInfoBuilder
withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo)
Definition
ShippingBuilder.php:177
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingCustomFieldsBuilder
withShippingCustomFieldsBuilder(?CustomFieldsBuilder $shippingCustomFields)
Definition
ShippingBuilder.php:210
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingKey
withShippingKey(?string $shippingKey)
Definition
ShippingBuilder.php:122
Commercetools\Api\Models\Cart\ShippingBuilder\getShippingAddress
getShippingAddress()
Definition
ShippingBuilder.php:85
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingAddressBuilder
withShippingAddressBuilder(?AddressBuilder $shippingAddress)
Definition
ShippingBuilder.php:188
Commercetools\Api\Models\Cart\ShippingBuilder\build
build()
Definition
ShippingBuilder.php:217
Commercetools\Api\Models\Cart\ShippingBuilder\getShippingRateInput
getShippingRateInput()
Definition
ShippingBuilder.php:102
Commercetools\Api\Models\Cart\ShippingBuilder\of
static of()
Definition
ShippingBuilder.php:228
Commercetools\Api\Models\Cart\ShippingBuilder\getShippingCustomFields
getShippingCustomFields()
Definition
ShippingBuilder.php:113
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingRateInputBuilder
withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput)
Definition
ShippingBuilder.php:199
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingRateInput
withShippingRateInput(?ShippingRateInput $shippingRateInput)
Definition
ShippingBuilder.php:155
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingInfo
withShippingInfo(?ShippingInfo $shippingInfo)
Definition
ShippingBuilder.php:133
Commercetools\Api\Models\Cart\ShippingBuilder\withShippingAddress
withShippingAddress(?Address $shippingAddress)
Definition
ShippingBuilder.php:144
Commercetools\Api\Models\Cart\ShippingInfoBuilder
Definition
ShippingInfoBuilder.php:33
Commercetools\Api\Models\Cart\ShippingInfoBuilder\build
build()
Definition
ShippingInfoBuilder.php:392
Commercetools\Api\Models\Cart\ShippingModel
Definition
ShippingModel.php:25
Commercetools\Api\Models\Cart\ShippingRateInputBuilder
Definition
ShippingRateInputBuilder.php:22
Commercetools\Api\Models\Cart\ShippingRateInputBuilder\build
build()
Definition
ShippingRateInputBuilder.php:23
Commercetools\Api\Models\Common\AddressBuilder
Definition
AddressBuilder.php:24
Commercetools\Api\Models\Common\AddressBuilder\build
build()
Definition
AddressBuilder.php:766
Commercetools\Api\Models\Type\CustomFieldsBuilder
Definition
CustomFieldsBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsBuilder\build
build()
Definition
CustomFieldsBuilder.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\Shipping
Definition
Shipping.php:17
Commercetools\Api\Models\Cart\ShippingInfo
Definition
ShippingInfo.php:21
Commercetools\Api\Models\Cart\ShippingRateInput
Definition
ShippingRateInput.php:15
Commercetools\Api\Models\Common\Address
Definition
Address.php:16
Commercetools\Api\Models\Type\CustomFields
Definition
CustomFields.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