commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
ChangeValue
InventoryQuantityValueModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\ChangeValue
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
InventoryQuantityValueModel
extends
JsonObjectModel
implements
InventoryQuantityValue
21
{
22
23
28
protected
$quantityOnStock
;
29
34
protected
$availableQuantity
;
35
36
40
public
function
__construct
(
41
?
int
$quantityOnStock
=
null
,
42
?
int
$availableQuantity
=
null
43
) {
44
$this->quantityOnStock =
$quantityOnStock
;
45
$this->availableQuantity =
$availableQuantity
;
46
47
}
48
55
public
function
getQuantityOnStock
()
56
{
57
if
(is_null($this->quantityOnStock)) {
59
$data = $this->
raw
(self::FIELD_QUANTITY_ON_STOCK);
60
if
(is_null($data)) {
61
return
null
;
62
}
63
$this->quantityOnStock = (int) $data;
64
}
65
66
return
$this->quantityOnStock
;
67
}
68
75
public
function
getAvailableQuantity
()
76
{
77
if
(is_null($this->availableQuantity)) {
79
$data = $this->
raw
(self::FIELD_AVAILABLE_QUANTITY);
80
if
(is_null($data)) {
81
return
null
;
82
}
83
$this->availableQuantity = (int) $data;
84
}
85
86
return
$this->availableQuantity
;
87
}
88
89
93
public
function
setQuantityOnStock
(?
int
$quantityOnStock
): void
94
{
95
$this->quantityOnStock =
$quantityOnStock
;
96
}
97
101
public
function
setAvailableQuantity
(?
int
$availableQuantity
): void
102
{
103
$this->availableQuantity =
$availableQuantity
;
104
}
105
106
107
108
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel
Definition
InventoryQuantityValueModel.php:21
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\setAvailableQuantity
setAvailableQuantity(?int $availableQuantity)
Definition
InventoryQuantityValueModel.php:101
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\getAvailableQuantity
getAvailableQuantity()
Definition
InventoryQuantityValueModel.php:75
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\$availableQuantity
$availableQuantity
Definition
InventoryQuantityValueModel.php:34
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\getQuantityOnStock
getQuantityOnStock()
Definition
InventoryQuantityValueModel.php:55
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\$quantityOnStock
$quantityOnStock
Definition
InventoryQuantityValueModel.php:28
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\setQuantityOnStock
setQuantityOnStock(?int $quantityOnStock)
Definition
InventoryQuantityValueModel.php:93
Commercetools\History\Models\ChangeValue\InventoryQuantityValueModel\__construct
__construct(?int $quantityOnStock=null, ?int $availableQuantity=null)
Definition
InventoryQuantityValueModel.php:40
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\ChangeValue\InventoryQuantityValue
Definition
InventoryQuantityValue.php:15
Commercetools\History\Models\ChangeValue
Definition
AssetChangeValue.php:9
Generated by
1.9.8