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
Inventory
InventoryEntryDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Inventory
;
10
11
use
Commercetools\Api\Models\Channel\ChannelResourceIdentifier
;
12
use
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder
;
13
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
14
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
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 DateTimeImmutable;
21
use stdClass;
22
26
final
class
InventoryEntryDraftBuilder
implements
Builder
27
{
32
private
$sku;
33
38
private
$key;
39
44
private
$supplyChannel;
45
50
private
$quantityOnStock;
51
56
private
$minCartQuantity;
57
62
private
$maxCartQuantity;
63
68
private
$restockableInDays;
69
74
private
$expectedDelivery;
75
80
private
$custom;
81
88
public
function
getSku
()
89
{
90
return
$this->sku;
91
}
92
100
public
function
getKey
()
101
{
102
return
$this->key;
103
}
104
111
public
function
getSupplyChannel
()
112
{
113
return
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel;
114
}
115
122
public
function
getQuantityOnStock
()
123
{
124
return
$this->quantityOnStock;
125
}
126
133
public
function
getMinCartQuantity
()
134
{
135
return
$this->minCartQuantity;
136
}
137
144
public
function
getMaxCartQuantity
()
145
{
146
return
$this->maxCartQuantity;
147
}
148
155
public
function
getRestockableInDays
()
156
{
157
return
$this->restockableInDays;
158
}
159
166
public
function
getExpectedDelivery
()
167
{
168
return
$this->expectedDelivery;
169
}
170
177
public
function
getCustom
()
178
{
179
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
180
}
181
186
public
function
withSku
(?
string
$sku)
187
{
188
$this->sku = $sku;
189
190
return
$this;
191
}
192
197
public
function
withKey
(?
string
$key)
198
{
199
$this->key = $key;
200
201
return
$this;
202
}
203
208
public
function
withSupplyChannel
(?
ChannelResourceIdentifier
$supplyChannel)
209
{
210
$this->supplyChannel = $supplyChannel;
211
212
return
$this;
213
}
214
219
public
function
withQuantityOnStock
(?
int
$quantityOnStock)
220
{
221
$this->quantityOnStock = $quantityOnStock;
222
223
return
$this;
224
}
225
230
public
function
withMinCartQuantity
(?
int
$minCartQuantity)
231
{
232
$this->minCartQuantity = $minCartQuantity;
233
234
return
$this;
235
}
236
241
public
function
withMaxCartQuantity
(?
int
$maxCartQuantity)
242
{
243
$this->maxCartQuantity = $maxCartQuantity;
244
245
return
$this;
246
}
247
252
public
function
withRestockableInDays
(?
int
$restockableInDays)
253
{
254
$this->restockableInDays = $restockableInDays;
255
256
return
$this;
257
}
258
263
public
function
withExpectedDelivery
(?DateTimeImmutable $expectedDelivery)
264
{
265
$this->expectedDelivery = $expectedDelivery;
266
267
return
$this;
268
}
269
274
public
function
withCustom
(?
CustomFieldsDraft
$custom)
275
{
276
$this->custom = $custom;
277
278
return
$this;
279
}
280
285
public
function
withSupplyChannelBuilder
(?
ChannelResourceIdentifierBuilder
$supplyChannel)
286
{
287
$this->supplyChannel = $supplyChannel;
288
289
return
$this;
290
}
291
296
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
297
{
298
$this->custom = $custom;
299
300
return
$this;
301
}
302
303
public
function
build
():
InventoryEntryDraft
304
{
305
return
new
InventoryEntryDraftModel
(
306
$this->sku,
307
$this->key,
308
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel,
309
$this->quantityOnStock,
310
$this->minCartQuantity,
311
$this->maxCartQuantity,
312
$this->restockableInDays,
313
$this->expectedDelivery,
314
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
315
);
316
}
317
318
public
static
function
of
():
InventoryEntryDraftBuilder
319
{
320
return
new
self
();
321
}
322
}
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder
Definition
ChannelResourceIdentifierBuilder.php:24
Commercetools\Api\Models\Channel\ChannelResourceIdentifierBuilder\build
build()
Definition
ChannelResourceIdentifierBuilder.php:82
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder
Definition
InventoryEntryDraftBuilder.php:27
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withMinCartQuantity
withMinCartQuantity(?int $minCartQuantity)
Definition
InventoryEntryDraftBuilder.php:230
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getSku
getSku()
Definition
InventoryEntryDraftBuilder.php:88
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getQuantityOnStock
getQuantityOnStock()
Definition
InventoryEntryDraftBuilder.php:122
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withSupplyChannel
withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
Definition
InventoryEntryDraftBuilder.php:208
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\of
static of()
Definition
InventoryEntryDraftBuilder.php:318
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getSupplyChannel
getSupplyChannel()
Definition
InventoryEntryDraftBuilder.php:111
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withSku
withSku(?string $sku)
Definition
InventoryEntryDraftBuilder.php:186
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withExpectedDelivery
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
Definition
InventoryEntryDraftBuilder.php:263
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withRestockableInDays
withRestockableInDays(?int $restockableInDays)
Definition
InventoryEntryDraftBuilder.php:252
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withSupplyChannelBuilder
withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel)
Definition
InventoryEntryDraftBuilder.php:285
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
InventoryEntryDraftBuilder.php:274
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getExpectedDelivery
getExpectedDelivery()
Definition
InventoryEntryDraftBuilder.php:166
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getCustom
getCustom()
Definition
InventoryEntryDraftBuilder.php:177
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getMinCartQuantity
getMinCartQuantity()
Definition
InventoryEntryDraftBuilder.php:133
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withQuantityOnStock
withQuantityOnStock(?int $quantityOnStock)
Definition
InventoryEntryDraftBuilder.php:219
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withMaxCartQuantity
withMaxCartQuantity(?int $maxCartQuantity)
Definition
InventoryEntryDraftBuilder.php:241
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\build
build()
Definition
InventoryEntryDraftBuilder.php:303
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getKey
getKey()
Definition
InventoryEntryDraftBuilder.php:100
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withKey
withKey(?string $key)
Definition
InventoryEntryDraftBuilder.php:197
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
InventoryEntryDraftBuilder.php:296
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getMaxCartQuantity
getMaxCartQuantity()
Definition
InventoryEntryDraftBuilder.php:144
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getRestockableInDays
getRestockableInDays()
Definition
InventoryEntryDraftBuilder.php:155
Commercetools\Api\Models\Inventory\InventoryEntryDraftModel
Definition
InventoryEntryDraftModel.php:26
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\Channel\ChannelResourceIdentifier
Definition
ChannelResourceIdentifier.php:16
Commercetools\Api\Models\Inventory\InventoryEntryDraft
Definition
InventoryEntryDraft.php:18
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\Inventory
Definition
InventoryEntry.php:9
Generated by
1.9.8