commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-import
src
Models
Inventories
InventoryImportBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Inventories
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use
Commercetools\Import\Models\Common\ChannelKeyReference
;
17
use
Commercetools\Import\Models\Common\ChannelKeyReferenceBuilder
;
18
use
Commercetools\Import\Models\Common\ImportResource
;
19
use
Commercetools\Import\Models\Common\ImportResourceBuilder
;
20
use
Commercetools\Import\Models\Customfields\Custom
;
21
use
Commercetools\Import\Models\Customfields\CustomBuilder
;
22
use DateTimeImmutable;
23
use stdClass;
24
28
final
class
InventoryImportBuilder
implements
Builder
29
{
34
private
$key;
35
40
private
$sku;
41
46
private
$quantityOnStock;
47
52
private
$restockableInDays;
53
58
private
$expectedDelivery;
59
64
private
$supplyChannel;
65
70
private
$custom;
71
78
public
function
getKey
()
79
{
80
return
$this->key;
81
}
82
89
public
function
getSku
()
90
{
91
return
$this->sku;
92
}
93
100
public
function
getQuantityOnStock
()
101
{
102
return
$this->quantityOnStock;
103
}
104
111
public
function
getRestockableInDays
()
112
{
113
return
$this->restockableInDays;
114
}
115
122
public
function
getExpectedDelivery
()
123
{
124
return
$this->expectedDelivery;
125
}
126
133
public
function
getSupplyChannel
()
134
{
135
return
$this->supplyChannel instanceof
ChannelKeyReferenceBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel;
136
}
137
144
public
function
getCustom
()
145
{
146
return
$this->custom instanceof
CustomBuilder
? $this->custom->
build
() : $this->custom;
147
}
148
153
public
function
withKey
(?
string
$key)
154
{
155
$this->key = $key;
156
157
return
$this;
158
}
159
164
public
function
withSku
(?
string
$sku)
165
{
166
$this->sku = $sku;
167
168
return
$this;
169
}
170
175
public
function
withQuantityOnStock
(?
int
$quantityOnStock)
176
{
177
$this->quantityOnStock = $quantityOnStock;
178
179
return
$this;
180
}
181
186
public
function
withRestockableInDays
(?
int
$restockableInDays)
187
{
188
$this->restockableInDays = $restockableInDays;
189
190
return
$this;
191
}
192
197
public
function
withExpectedDelivery
(?DateTimeImmutable $expectedDelivery)
198
{
199
$this->expectedDelivery = $expectedDelivery;
200
201
return
$this;
202
}
203
208
public
function
withSupplyChannel
(?
ChannelKeyReference
$supplyChannel)
209
{
210
$this->supplyChannel = $supplyChannel;
211
212
return
$this;
213
}
214
219
public
function
withCustom
(?
Custom
$custom)
220
{
221
$this->custom = $custom;
222
223
return
$this;
224
}
225
230
public
function
withSupplyChannelBuilder
(?
ChannelKeyReferenceBuilder
$supplyChannel)
231
{
232
$this->supplyChannel = $supplyChannel;
233
234
return
$this;
235
}
236
241
public
function
withCustomBuilder
(?
CustomBuilder
$custom)
242
{
243
$this->custom = $custom;
244
245
return
$this;
246
}
247
248
public
function
build
():
InventoryImport
249
{
250
return
new
InventoryImportModel
(
251
$this->key,
252
$this->sku,
253
$this->quantityOnStock,
254
$this->restockableInDays,
255
$this->expectedDelivery,
256
$this->supplyChannel instanceof
ChannelKeyReferenceBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel,
257
$this->custom instanceof
CustomBuilder
? $this->custom->
build
() : $this->custom
258
);
259
}
260
261
public
static
function
of
():
InventoryImportBuilder
262
{
263
return
new
self
();
264
}
265
}
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Import\Models\Common\ChannelKeyReferenceBuilder
Definition
ChannelKeyReferenceBuilder.php:22
Commercetools\Import\Models\Common\ChannelKeyReferenceBuilder\build
build()
Definition
ChannelKeyReferenceBuilder.php:50
Commercetools\Import\Models\Common\ImportResourceBuilder
Definition
ImportResourceBuilder.php:44
Commercetools\Import\Models\Customfields\CustomBuilder
Definition
CustomBuilder.php:24
Commercetools\Import\Models\Customfields\CustomBuilder\build
build()
Definition
CustomBuilder.php:103
Commercetools\Import\Models\Inventories\InventoryImportBuilder
Definition
InventoryImportBuilder.php:29
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getSku
getSku()
Definition
InventoryImportBuilder.php:89
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withSupplyChannelBuilder
withSupplyChannelBuilder(?ChannelKeyReferenceBuilder $supplyChannel)
Definition
InventoryImportBuilder.php:230
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getQuantityOnStock
getQuantityOnStock()
Definition
InventoryImportBuilder.php:100
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getSupplyChannel
getSupplyChannel()
Definition
InventoryImportBuilder.php:133
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getRestockableInDays
getRestockableInDays()
Definition
InventoryImportBuilder.php:111
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withRestockableInDays
withRestockableInDays(?int $restockableInDays)
Definition
InventoryImportBuilder.php:186
Commercetools\Import\Models\Inventories\InventoryImportBuilder\of
static of()
Definition
InventoryImportBuilder.php:261
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getCustom
getCustom()
Definition
InventoryImportBuilder.php:144
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getKey
getKey()
Definition
InventoryImportBuilder.php:78
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withCustomBuilder
withCustomBuilder(?CustomBuilder $custom)
Definition
InventoryImportBuilder.php:241
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withExpectedDelivery
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
Definition
InventoryImportBuilder.php:197
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withQuantityOnStock
withQuantityOnStock(?int $quantityOnStock)
Definition
InventoryImportBuilder.php:175
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withSku
withSku(?string $sku)
Definition
InventoryImportBuilder.php:164
Commercetools\Import\Models\Inventories\InventoryImportBuilder\getExpectedDelivery
getExpectedDelivery()
Definition
InventoryImportBuilder.php:122
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withCustom
withCustom(?Custom $custom)
Definition
InventoryImportBuilder.php:219
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withKey
withKey(?string $key)
Definition
InventoryImportBuilder.php:153
Commercetools\Import\Models\Inventories\InventoryImportBuilder\withSupplyChannel
withSupplyChannel(?ChannelKeyReference $supplyChannel)
Definition
InventoryImportBuilder.php:208
Commercetools\Import\Models\Inventories\InventoryImportBuilder\build
build()
Definition
InventoryImportBuilder.php:248
Commercetools\Import\Models\Inventories\InventoryImportModel
Definition
InventoryImportModel.php:28
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Import\Models\Common\ChannelKeyReference
Definition
ChannelKeyReference.php:15
Commercetools\Import\Models\Common\ImportResource
Definition
ImportResource.php:26
Commercetools\Import\Models\Customfields\Custom
Definition
Custom.php:16
Commercetools\Import\Models\Inventories\InventoryImport
Definition
InventoryImport.php:19
Commercetools\Import\Models\Inventories
Definition
InventoryImport.php:9
Generated by
1.9.8