commercetools-sdk-php-v2
master
The platform, import-api and ml-api PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Orders
DeliveryItemModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Orders
;
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
DeliveryItemModel
extends
JsonObjectModel
implements
DeliveryItem
21
{
26
protected
$id
;
27
32
protected
$quantity
;
33
34
38
public
function
__construct
(
39
?
string
$id
=
null
,
40
?
int
$quantity
=
null
41
) {
42
$this->
id
=
$id
;
43
$this->quantity =
$quantity
;
44
}
45
50
public
function
getId
()
51
{
52
if
(is_null($this->
id
)) {
54
$data = $this->
raw
(self::FIELD_ID);
55
if
(is_null($data)) {
56
return
null
;
57
}
58
$this->
id
= (string) $data;
59
}
60
61
return
$this->id
;
62
}
63
68
public
function
getQuantity
()
69
{
70
if
(is_null($this->quantity)) {
72
$data = $this->
raw
(self::FIELD_QUANTITY);
73
if
(is_null($data)) {
74
return
null
;
75
}
76
$this->quantity = (int) $data;
77
}
78
79
return
$this->quantity
;
80
}
81
82
86
public
function
setId
(?
string
$id
): void
87
{
88
$this->
id
=
$id
;
89
}
90
94
public
function
setQuantity
(?
int
$quantity
): void
95
{
96
$this->quantity =
$quantity
;
97
}
98
}
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\Import\Models\Orders\DeliveryItemModel
Definition:
DeliveryItemModel.php:21
Commercetools\Import\Models\Orders\DeliveryItemModel\setId
setId(?string $id)
Definition:
DeliveryItemModel.php:86
Commercetools\Import\Models\Orders\DeliveryItemModel\$quantity
$quantity
Definition:
DeliveryItemModel.php:32
Commercetools\Import\Models\Orders\DeliveryItemModel\getQuantity
getQuantity()
Definition:
DeliveryItemModel.php:68
Commercetools\Import\Models\Orders\DeliveryItemModel\__construct
__construct(?string $id=null, ?int $quantity=null)
Definition:
DeliveryItemModel.php:38
Commercetools\Import\Models\Orders\DeliveryItemModel\getId
getId()
Definition:
DeliveryItemModel.php:50
Commercetools\Import\Models\Orders\DeliveryItemModel\setQuantity
setQuantity(?int $quantity)
Definition:
DeliveryItemModel.php:94
Commercetools\Import\Models\Orders\DeliveryItemModel\$id
$id
Definition:
DeliveryItemModel.php:26
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Orders\DeliveryItem
Definition:
DeliveryItem.php:15
Commercetools\Import\Models\Orders
Definition:
CartClassificationTier.php:9
Generated by
1.9.1