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
InventoryEntryBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Inventory
;
10
11
use
Commercetools\Api\Models\Channel\ChannelReference
;
12
use
Commercetools\Api\Models\Channel\ChannelReferenceBuilder
;
13
use
Commercetools\Api\Models\Common\BaseResource
;
14
use
Commercetools\Api\Models\Common\BaseResourceBuilder
;
15
use
Commercetools\Api\Models\Common\CreatedBy
;
16
use
Commercetools\Api\Models\Common\CreatedByBuilder
;
17
use
Commercetools\Api\Models\Common\LastModifiedBy
;
18
use
Commercetools\Api\Models\Common\LastModifiedByBuilder
;
19
use
Commercetools\Api\Models\Type\CustomFields
;
20
use
Commercetools\Api\Models\Type\CustomFieldsBuilder
;
21
use
Commercetools\Base\Builder
;
22
use
Commercetools\Base\DateTimeImmutableCollection
;
23
use
Commercetools\Base\JsonObject
;
24
use
Commercetools\Base\JsonObjectModel
;
25
use
Commercetools\Base\MapperFactory
;
26
use DateTimeImmutable;
27
use stdClass;
28
32
final
class
InventoryEntryBuilder
implements
Builder
33
{
38
private
$id;
39
44
private
$version;
45
50
private
$createdAt;
51
56
private
$lastModifiedAt;
57
62
private
$lastModifiedBy;
63
68
private
$createdBy;
69
74
private
$key;
75
80
private
$sku;
81
86
private
$supplyChannel;
87
92
private
$quantityOnStock;
93
98
private
$availableQuantity;
99
104
private
$restockableInDays;
105
110
private
$expectedDelivery;
111
116
private
$custom;
117
124
public
function
getId
()
125
{
126
return
$this->id;
127
}
128
135
public
function
getVersion
()
136
{
137
return
$this->version;
138
}
139
146
public
function
getCreatedAt
()
147
{
148
return
$this->createdAt;
149
}
150
157
public
function
getLastModifiedAt
()
158
{
159
return
$this->lastModifiedAt;
160
}
161
168
public
function
getLastModifiedBy
()
169
{
170
return
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy;
171
}
172
179
public
function
getCreatedBy
()
180
{
181
return
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy;
182
}
183
190
public
function
getKey
()
191
{
192
return
$this->key;
193
}
194
201
public
function
getSku
()
202
{
203
return
$this->sku;
204
}
205
212
public
function
getSupplyChannel
()
213
{
214
return
$this->supplyChannel instanceof
ChannelReferenceBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel;
215
}
216
223
public
function
getQuantityOnStock
()
224
{
225
return
$this->quantityOnStock;
226
}
227
234
public
function
getAvailableQuantity
()
235
{
236
return
$this->availableQuantity;
237
}
238
245
public
function
getRestockableInDays
()
246
{
247
return
$this->restockableInDays;
248
}
249
256
public
function
getExpectedDelivery
()
257
{
258
return
$this->expectedDelivery;
259
}
260
267
public
function
getCustom
()
268
{
269
return
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom;
270
}
271
276
public
function
withId
(?
string
$id)
277
{
278
$this->
id
= $id;
279
280
return
$this;
281
}
282
287
public
function
withVersion
(?
int
$version)
288
{
289
$this->version = $version;
290
291
return
$this;
292
}
293
298
public
function
withCreatedAt
(?DateTimeImmutable $createdAt)
299
{
300
$this->createdAt = $createdAt;
301
302
return
$this;
303
}
304
309
public
function
withLastModifiedAt
(?DateTimeImmutable $lastModifiedAt)
310
{
311
$this->lastModifiedAt = $lastModifiedAt;
312
313
return
$this;
314
}
315
320
public
function
withLastModifiedBy
(?
LastModifiedBy
$lastModifiedBy)
321
{
322
$this->lastModifiedBy = $lastModifiedBy;
323
324
return
$this;
325
}
326
331
public
function
withCreatedBy
(?
CreatedBy
$createdBy)
332
{
333
$this->createdBy = $createdBy;
334
335
return
$this;
336
}
337
342
public
function
withKey
(?
string
$key)
343
{
344
$this->key = $key;
345
346
return
$this;
347
}
348
353
public
function
withSku
(?
string
$sku)
354
{
355
$this->sku = $sku;
356
357
return
$this;
358
}
359
364
public
function
withSupplyChannel
(?
ChannelReference
$supplyChannel)
365
{
366
$this->supplyChannel = $supplyChannel;
367
368
return
$this;
369
}
370
375
public
function
withQuantityOnStock
(?
int
$quantityOnStock)
376
{
377
$this->quantityOnStock = $quantityOnStock;
378
379
return
$this;
380
}
381
386
public
function
withAvailableQuantity
(?
int
$availableQuantity)
387
{
388
$this->availableQuantity = $availableQuantity;
389
390
return
$this;
391
}
392
397
public
function
withRestockableInDays
(?
int
$restockableInDays)
398
{
399
$this->restockableInDays = $restockableInDays;
400
401
return
$this;
402
}
403
408
public
function
withExpectedDelivery
(?DateTimeImmutable $expectedDelivery)
409
{
410
$this->expectedDelivery = $expectedDelivery;
411
412
return
$this;
413
}
414
419
public
function
withCustom
(?
CustomFields
$custom)
420
{
421
$this->custom = $custom;
422
423
return
$this;
424
}
425
430
public
function
withLastModifiedByBuilder
(?
LastModifiedByBuilder
$lastModifiedBy)
431
{
432
$this->lastModifiedBy = $lastModifiedBy;
433
434
return
$this;
435
}
436
441
public
function
withCreatedByBuilder
(?
CreatedByBuilder
$createdBy)
442
{
443
$this->createdBy = $createdBy;
444
445
return
$this;
446
}
447
452
public
function
withSupplyChannelBuilder
(?
ChannelReferenceBuilder
$supplyChannel)
453
{
454
$this->supplyChannel = $supplyChannel;
455
456
return
$this;
457
}
458
463
public
function
withCustomBuilder
(?
CustomFieldsBuilder
$custom)
464
{
465
$this->custom = $custom;
466
467
return
$this;
468
}
469
470
public
function
build
():
InventoryEntry
471
{
472
return
new
InventoryEntryModel
(
473
$this->
id
,
474
$this->version,
475
$this->createdAt,
476
$this->lastModifiedAt,
477
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy,
478
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy,
479
$this->key,
480
$this->sku,
481
$this->supplyChannel instanceof
ChannelReferenceBuilder
? $this->supplyChannel->
build
() : $this->supplyChannel,
482
$this->quantityOnStock,
483
$this->availableQuantity,
484
$this->restockableInDays,
485
$this->expectedDelivery,
486
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom
487
);
488
}
489
490
public
static
function
of
():
InventoryEntryBuilder
491
{
492
return
new
self
();
493
}
494
}
Commercetools\Api\Models\Channel\ChannelReferenceBuilder
Definition
ChannelReferenceBuilder.php:24
Commercetools\Api\Models\Channel\ChannelReferenceBuilder\build
build()
Definition
ChannelReferenceBuilder.php:93
Commercetools\Api\Models\Common\BaseResourceBuilder
Definition
BaseResourceBuilder.php:491
Commercetools\Api\Models\Common\CreatedByBuilder
Definition
CreatedByBuilder.php:24
Commercetools\Api\Models\Common\CreatedByBuilder\build
build()
Definition
CreatedByBuilder.php:226
Commercetools\Api\Models\Common\LastModifiedByBuilder
Definition
LastModifiedByBuilder.php:24
Commercetools\Api\Models\Common\LastModifiedByBuilder\build
build()
Definition
LastModifiedByBuilder.php:226
Commercetools\Api\Models\Inventory\InventoryEntryBuilder
Definition
InventoryEntryBuilder.php:33
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withId
withId(?string $id)
Definition
InventoryEntryBuilder.php:276
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getSku
getSku()
Definition
InventoryEntryBuilder.php:201
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withLastModifiedAt
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
Definition
InventoryEntryBuilder.php:309
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withSupplyChannel
withSupplyChannel(?ChannelReference $supplyChannel)
Definition
InventoryEntryBuilder.php:364
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withExpectedDelivery
withExpectedDelivery(?DateTimeImmutable $expectedDelivery)
Definition
InventoryEntryBuilder.php:408
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getId
getId()
Definition
InventoryEntryBuilder.php:124
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getRestockableInDays
getRestockableInDays()
Definition
InventoryEntryBuilder.php:245
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withKey
withKey(?string $key)
Definition
InventoryEntryBuilder.php:342
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getVersion
getVersion()
Definition
InventoryEntryBuilder.php:135
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withCustom
withCustom(?CustomFields $custom)
Definition
InventoryEntryBuilder.php:419
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsBuilder $custom)
Definition
InventoryEntryBuilder.php:463
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withCreatedAt
withCreatedAt(?DateTimeImmutable $createdAt)
Definition
InventoryEntryBuilder.php:298
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withCreatedBy
withCreatedBy(?CreatedBy $createdBy)
Definition
InventoryEntryBuilder.php:331
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getCreatedAt
getCreatedAt()
Definition
InventoryEntryBuilder.php:146
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withRestockableInDays
withRestockableInDays(?int $restockableInDays)
Definition
InventoryEntryBuilder.php:397
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withSupplyChannelBuilder
withSupplyChannelBuilder(?ChannelReferenceBuilder $supplyChannel)
Definition
InventoryEntryBuilder.php:452
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getSupplyChannel
getSupplyChannel()
Definition
InventoryEntryBuilder.php:212
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getExpectedDelivery
getExpectedDelivery()
Definition
InventoryEntryBuilder.php:256
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getQuantityOnStock
getQuantityOnStock()
Definition
InventoryEntryBuilder.php:223
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getKey
getKey()
Definition
InventoryEntryBuilder.php:190
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getCreatedBy
getCreatedBy()
Definition
InventoryEntryBuilder.php:179
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getLastModifiedAt
getLastModifiedAt()
Definition
InventoryEntryBuilder.php:157
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withVersion
withVersion(?int $version)
Definition
InventoryEntryBuilder.php:287
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getLastModifiedBy
getLastModifiedBy()
Definition
InventoryEntryBuilder.php:168
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\build
build()
Definition
InventoryEntryBuilder.php:470
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withLastModifiedBy
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
Definition
InventoryEntryBuilder.php:320
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getCustom
getCustom()
Definition
InventoryEntryBuilder.php:267
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withCreatedByBuilder
withCreatedByBuilder(?CreatedByBuilder $createdBy)
Definition
InventoryEntryBuilder.php:441
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\of
static of()
Definition
InventoryEntryBuilder.php:490
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withSku
withSku(?string $sku)
Definition
InventoryEntryBuilder.php:353
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withLastModifiedByBuilder
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
Definition
InventoryEntryBuilder.php:430
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withQuantityOnStock
withQuantityOnStock(?int $quantityOnStock)
Definition
InventoryEntryBuilder.php:375
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\getAvailableQuantity
getAvailableQuantity()
Definition
InventoryEntryBuilder.php:234
Commercetools\Api\Models\Inventory\InventoryEntryBuilder\withAvailableQuantity
withAvailableQuantity(?int $availableQuantity)
Definition
InventoryEntryBuilder.php:386
Commercetools\Api\Models\Inventory\InventoryEntryModel
Definition
InventoryEntryModel.php:32
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\Channel\ChannelReference
Definition
ChannelReference.php:16
Commercetools\Api\Models\Common\BaseResource
Definition
BaseResource.php:250
Commercetools\Api\Models\Common\CreatedBy
Definition
CreatedBy.php:16
Commercetools\Api\Models\Common\LastModifiedBy
Definition
LastModifiedBy.php:16
Commercetools\Api\Models\Inventory\InventoryEntry
Definition
InventoryEntry.php:21
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\Inventory
Definition
InventoryEntry.php:9
Generated by
1.9.8