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
Me
MyLineItemDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Me
;
10
11
use
Commercetools\Api\Models\Cart\ItemShippingDetailsDraft
;
12
use
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder
;
13
use
Commercetools\Api\Models\Channel\ChannelResourceIdentifier
;
14
use
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder
;
15
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
17
use
Commercetools\Base\Builder
;
18
use
Commercetools\Base\DateTimeImmutableCollection
;
19
use
Commercetools\Base\JsonObject
;
20
use
Commercetools\Base\JsonObjectModel
;
21
use
Commercetools\Base\MapperFactory
;
22
use DateTimeImmutable;
23
use stdClass;
24
28
final
class
MyLineItemDraftBuilder
implements
Builder
29
{
34
private
$key;
35
40
private
$productId;
41
46
private
$variantId;
47
52
private
$sku;
53
58
private
$quantity;
59
64
private
$addedAt;
65
70
private
$supplyChannel;
71
76
private
$distributionChannel;
77
82
private
$shippingDetails;
83
88
private
$custom;
89
96
public
function
getKey
()
97
{
98
return
$this->key;
99
}
100
107
public
function
getProductId
()
108
{
109
return
$this->productId;
110
}
111
119
public
function
getVariantId
()
120
{
121
return
$this->variantId;
122
}
123
130
public
function
getSku
()
131
{
132
return
$this->sku;
133
}
134
141
public
function
getQuantity
()
142
{
143
return
$this->quantity;
144
}
145
154
public
function
getAddedAt
()
155
{
156
return
$this->addedAt;
157
}
158
166
public
function
getSupplyChannel
()
167
{
168
return
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel;
169
}
170
180
public
function
getDistributionChannel
()
181
{
182
return
$this->distributionChannel instanceof
ChannelResourceIdentifierBuilder
? $this->distributionChannel->
build
() : $this->distributionChannel;
183
}
184
191
public
function
getShippingDetails
()
192
{
193
return
$this->shippingDetails instanceof
ItemShippingDetailsDraftBuilder
? $this->shippingDetails->
build
() : $this->shippingDetails;
194
}
195
202
public
function
getCustom
()
203
{
204
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
205
}
206
211
public
function
withKey
(?
string
$key)
212
{
213
$this->key = $key;
214
215
return
$this;
216
}
217
222
public
function
withProductId
(?
string
$productId)
223
{
224
$this->productId = $productId;
225
226
return
$this;
227
}
228
233
public
function
withVariantId
(?
int
$variantId)
234
{
235
$this->variantId = $variantId;
236
237
return
$this;
238
}
239
244
public
function
withSku
(?
string
$sku)
245
{
246
$this->sku = $sku;
247
248
return
$this;
249
}
250
255
public
function
withQuantity
(?
int
$quantity)
256
{
257
$this->quantity = $quantity;
258
259
return
$this;
260
}
261
266
public
function
withAddedAt
(?DateTimeImmutable $addedAt)
267
{
268
$this->addedAt = $addedAt;
269
270
return
$this;
271
}
272
277
public
function
withSupplyChannel
(?
ChannelResourceIdentifier
$supplyChannel)
278
{
279
$this->supplyChannel = $supplyChannel;
280
281
return
$this;
282
}
283
288
public
function
withDistributionChannel
(?
ChannelResourceIdentifier
$distributionChannel)
289
{
290
$this->distributionChannel = $distributionChannel;
291
292
return
$this;
293
}
294
299
public
function
withShippingDetails
(?
ItemShippingDetailsDraft
$shippingDetails)
300
{
301
$this->shippingDetails = $shippingDetails;
302
303
return
$this;
304
}
305
310
public
function
withCustom
(?
CustomFieldsDraft
$custom)
311
{
312
$this->custom = $custom;
313
314
return
$this;
315
}
316
321
public
function
withSupplyChannelBuilder
(?
ChannelResourceIdentifierBuilder
$supplyChannel)
322
{
323
$this->supplyChannel = $supplyChannel;
324
325
return
$this;
326
}
327
332
public
function
withDistributionChannelBuilder
(?
ChannelResourceIdentifierBuilder
$distributionChannel)
333
{
334
$this->distributionChannel = $distributionChannel;
335
336
return
$this;
337
}
338
343
public
function
withShippingDetailsBuilder
(?
ItemShippingDetailsDraftBuilder
$shippingDetails)
344
{
345
$this->shippingDetails = $shippingDetails;
346
347
return
$this;
348
}
349
354
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
355
{
356
$this->custom = $custom;
357
358
return
$this;
359
}
360
361
public
function
build
():
MyLineItemDraft
362
{
363
return
new
MyLineItemDraftModel
(
364
$this->key,
365
$this->productId,
366
$this->variantId,
367
$this->sku,
368
$this->quantity,
369
$this->addedAt,
370
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel,
371
$this->distributionChannel instanceof
ChannelResourceIdentifierBuilder
? $this->distributionChannel->
build
() : $this->distributionChannel,
372
$this->shippingDetails instanceof
ItemShippingDetailsDraftBuilder
? $this->shippingDetails->
build
() : $this->shippingDetails,
373
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
374
);
375
}
376
377
public
static
function
of
():
MyLineItemDraftBuilder
378
{
379
return
new
self
();
380
}
381
}
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder
Definition
ItemShippingDetailsDraftBuilder.php:22
Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder\build
build()
Definition
ItemShippingDetailsDraftBuilder.php:53
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder
Definition
ChannelResourceIdentifierBuilder.php:24
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder\build
build()
Definition
ChannelResourceIdentifierBuilder.php:82
Commercetools\Api\Models\Me\MyLineItemDraftBuilder
Definition
MyLineItemDraftBuilder.php:29
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getVariantId
getVariantId()
Definition
MyLineItemDraftBuilder.php:119
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withDistributionChannel
withDistributionChannel(?ChannelResourceIdentifier $distributionChannel)
Definition
MyLineItemDraftBuilder.php:288
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withShippingDetails
withShippingDetails(?ItemShippingDetailsDraft $shippingDetails)
Definition
MyLineItemDraftBuilder.php:299
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getAddedAt
getAddedAt()
Definition
MyLineItemDraftBuilder.php:154
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getShippingDetails
getShippingDetails()
Definition
MyLineItemDraftBuilder.php:191
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withDistributionChannelBuilder
withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel)
Definition
MyLineItemDraftBuilder.php:332
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getDistributionChannel
getDistributionChannel()
Definition
MyLineItemDraftBuilder.php:180
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withShippingDetailsBuilder
withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails)
Definition
MyLineItemDraftBuilder.php:343
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withQuantity
withQuantity(?int $quantity)
Definition
MyLineItemDraftBuilder.php:255
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withAddedAt
withAddedAt(?DateTimeImmutable $addedAt)
Definition
MyLineItemDraftBuilder.php:266
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withSku
withSku(?string $sku)
Definition
MyLineItemDraftBuilder.php:244
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withProductId
withProductId(?string $productId)
Definition
MyLineItemDraftBuilder.php:222
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getSku
getSku()
Definition
MyLineItemDraftBuilder.php:130
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\of
static of()
Definition
MyLineItemDraftBuilder.php:377
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withSupplyChannel
withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
Definition
MyLineItemDraftBuilder.php:277
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getProductId
getProductId()
Definition
MyLineItemDraftBuilder.php:107
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withVariantId
withVariantId(?int $variantId)
Definition
MyLineItemDraftBuilder.php:233
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withKey
withKey(?string $key)
Definition
MyLineItemDraftBuilder.php:211
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getKey
getKey()
Definition
MyLineItemDraftBuilder.php:96
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
MyLineItemDraftBuilder.php:310
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getQuantity
getQuantity()
Definition
MyLineItemDraftBuilder.php:141
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
MyLineItemDraftBuilder.php:354
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getCustom
getCustom()
Definition
MyLineItemDraftBuilder.php:202
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\withSupplyChannelBuilder
withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel)
Definition
MyLineItemDraftBuilder.php:321
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\build
build()
Definition
MyLineItemDraftBuilder.php:361
Commercetools\Api\Models\Me\MyLineItemDraftBuilder\getSupplyChannel
getSupplyChannel()
Definition
MyLineItemDraftBuilder.php:166
Commercetools\Api\Models\Me\MyLineItemDraftModel
Definition
MyLineItemDraftModel.php:28
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\ItemShippingDetailsDraft
Definition
ItemShippingDetailsDraft.php:15
Commercetools\Api\Models\Channel\ChannelResourceIdentifier
Definition
ChannelResourceIdentifier.php:16
Commercetools\Api\Models\Me\MyLineItemDraft
Definition
MyLineItemDraft.php:19
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\Me
Definition
MyBusinessUnitAddAddressAction.php:9
Generated by
1.9.8