commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
OrderPatches
ParcelItemsModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\OrderPatches
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use
Commercetools\Import\Models\Orders\DeliveryItemCollection
;
16
use stdClass;
17
21
final
class
ParcelItemsModel
extends
JsonObjectModel
implements
ParcelItems
22
{
27
protected
$parcelId
;
28
33
protected
$items
;
34
35
39
public
function
__construct
(
40
?
string
$parcelId
=
null
,
41
?
DeliveryItemCollection
$items
=
null
42
) {
43
$this->parcelId =
$parcelId
;
44
$this->items =
$items
;
45
}
46
51
public
function
getParcelId
()
52
{
53
if
(is_null($this->parcelId)) {
55
$data = $this->
raw
(self::FIELD_PARCEL_ID);
56
if
(is_null($data)) {
57
return
null
;
58
}
59
$this->parcelId = (string) $data;
60
}
61
62
return
$this->parcelId
;
63
}
64
69
public
function
getItems
()
70
{
71
if
(is_null($this->items)) {
73
$data = $this->
raw
(self::FIELD_ITEMS);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->items =
DeliveryItemCollection::fromArray
($data);
78
}
79
80
return
$this->items
;
81
}
82
83
87
public
function
setParcelId
(?
string
$parcelId
): void
88
{
89
$this->parcelId =
$parcelId
;
90
}
91
95
public
function
setItems
(?
DeliveryItemCollection
$items
): void
96
{
97
$this->items =
$items
;
98
}
99
}
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\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Import\Models\OrderPatches\ParcelItemsModel
Definition:
ParcelItemsModel.php:22
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\$items
$items
Definition:
ParcelItemsModel.php:33
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\__construct
__construct(?string $parcelId=null, ?DeliveryItemCollection $items=null)
Definition:
ParcelItemsModel.php:39
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\$parcelId
$parcelId
Definition:
ParcelItemsModel.php:27
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\setParcelId
setParcelId(?string $parcelId)
Definition:
ParcelItemsModel.php:87
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\getItems
getItems()
Definition:
ParcelItemsModel.php:69
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\setItems
setItems(?DeliveryItemCollection $items)
Definition:
ParcelItemsModel.php:95
Commercetools\Import\Models\OrderPatches\ParcelItemsModel\getParcelId
getParcelId()
Definition:
ParcelItemsModel.php:51
Commercetools\Import\Models\Orders\DeliveryItemCollection
Definition:
DeliveryItemCollection.php:22
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\OrderPatches\ParcelItems
Definition:
ParcelItems.php:16
Commercetools\Import\Models\OrderPatches
Definition:
DeliveryAddressDraft.php:9
Generated by
1.9.1