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
$restockableInDays;
57
62
private
$expectedDelivery;
63
68
private
$custom;
69
76
public
function
getSku
()
77
{
78
return
$this->sku;
79
}
80
88
public
function
getKey
()
89
{
90
return
$this->key;
91
}
92
99
public
function
getSupplyChannel
()
100
{
101
return
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel;
102
}
103
110
public
function
getQuantityOnStock
()
111
{
112
return
$this->quantityOnStock;
113
}
114
121
public
function
getRestockableInDays
()
122
{
123
return
$this->restockableInDays;
124
}
125
132
public
function
getExpectedDelivery
()
133
{
134
return
$this->expectedDelivery;
135
}
136
143
public
function
getCustom
()
144
{
145
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
146
}
147
152
public
function
withSku
(?
string
$sku)
153
{
154
$this->sku = $sku;
155
156
return
$this;
157
}
158
163
public
function
withKey
(?
string
$key)
164
{
165
$this->key = $key;
166
167
return
$this;
168
}
169
174
public
function
withSupplyChannel
(?
ChannelResourceIdentifier
$supplyChannel)
175
{
176
$this->supplyChannel = $supplyChannel;
177
178
return
$this;
179
}
180
185
public
function
withQuantityOnStock
(?
int
$quantityOnStock)
186
{
187
$this->quantityOnStock = $quantityOnStock;
188
189
return
$this;
190
}
191
196
public
function
withRestockableInDays
(?
int
$restockableInDays)
197
{
198
$this->restockableInDays = $restockableInDays;
199
200
return
$this;
201
}
202
207
public
function
withExpectedDelivery
(?DateTimeImmutable $expectedDelivery)
208
{
209
$this->expectedDelivery = $expectedDelivery;
210
211
return
$this;
212
}
213
218
public
function
withCustom
(?
CustomFieldsDraft
$custom)
219
{
220
$this->custom = $custom;
221
222
return
$this;
223
}
224
229
public
function
withSupplyChannelBuilder
(?
ChannelResourceIdentifierBuilder
$supplyChannel)
230
{
231
$this->supplyChannel = $supplyChannel;
232
233
return
$this;
234
}
235
240
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
241
{
242
$this->custom = $custom;
243
244
return
$this;
245
}
246
247
public
function
build
():
InventoryEntryDraft
248
{
249
return
new
InventoryEntryDraftModel
(
250
$this->sku,
251
$this->key,
252
$this->supplyChannel instanceof
ChannelResourceIdentifierBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel,
253
$this->quantityOnStock,
254
$this->restockableInDays,
255
$this->expectedDelivery,
256
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
257
);
258
}
259
260
public
static
function
of
():
InventoryEntryDraftBuilder
261
{
262
return
new
self
();
263
}
264
}
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\getSku
getSku()
Definition
InventoryEntryDraftBuilder.php:76
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getQuantityOnStock
getQuantityOnStock()
Definition
InventoryEntryDraftBuilder.php:110
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withSupplyChannel
withSupplyChannel(?ChannelResourceIdentifier $supplyChannel)
Definition
InventoryEntryDraftBuilder.php:174
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\of
static of()
Definition
InventoryEntryDraftBuilder.php:260
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getSupplyChannel
getSupplyChannel()
Definition
InventoryEntryDraftBuilder.php:99
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withSku
withSku(?string $sku)
Definition
InventoryEntryDraftBuilder.php:152
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withExpectedDelivery
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
Definition
InventoryEntryDraftBuilder.php:207
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withRestockableInDays
withRestockableInDays(?int $restockableInDays)
Definition
InventoryEntryDraftBuilder.php:196
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withSupplyChannelBuilder
withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel)
Definition
InventoryEntryDraftBuilder.php:229
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
InventoryEntryDraftBuilder.php:218
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getExpectedDelivery
getExpectedDelivery()
Definition
InventoryEntryDraftBuilder.php:132
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getCustom
getCustom()
Definition
InventoryEntryDraftBuilder.php:143
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withQuantityOnStock
withQuantityOnStock(?int $quantityOnStock)
Definition
InventoryEntryDraftBuilder.php:185
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\build
build()
Definition
InventoryEntryDraftBuilder.php:247
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getKey
getKey()
Definition
InventoryEntryDraftBuilder.php:88
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withKey
withKey(?string $key)
Definition
InventoryEntryDraftBuilder.php:163
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
InventoryEntryDraftBuilder.php:240
Commercetools\Api\Models\Inventory\InventoryEntryDraftBuilder\getRestockableInDays
getRestockableInDays()
Definition
InventoryEntryDraftBuilder.php:121
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