commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
OrderPatches
ParcelTrackingDataModel.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\TrackingData
;
16
use
Commercetools\Import\Models\Orders\TrackingDataModel
;
17
use stdClass;
18
22
final
class
ParcelTrackingDataModel
extends
JsonObjectModel
implements
ParcelTrackingData
23
{
28
protected
$parcelId
;
29
34
protected
$trackingData
;
35
36
40
public
function
__construct
(
41
?
string
$parcelId
=
null
,
42
?
TrackingData
$trackingData
=
null
43
) {
44
$this->parcelId =
$parcelId
;
45
$this->trackingData =
$trackingData
;
46
}
47
52
public
function
getParcelId
()
53
{
54
if
(is_null($this->parcelId)) {
56
$data = $this->
raw
(self::FIELD_PARCEL_ID);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
$this->parcelId = (string) $data;
61
}
62
63
return
$this->parcelId
;
64
}
65
70
public
function
getTrackingData
()
71
{
72
if
(is_null($this->trackingData)) {
74
$data = $this->
raw
(self::FIELD_TRACKING_DATA);
75
if
(is_null($data)) {
76
return
null
;
77
}
78
79
$this->trackingData =
TrackingDataModel::of
($data);
80
}
81
82
return
$this->trackingData
;
83
}
84
85
89
public
function
setParcelId
(?
string
$parcelId
): void
90
{
91
$this->parcelId =
$parcelId
;
92
}
93
97
public
function
setTrackingData
(?
TrackingData
$trackingData
): void
98
{
99
$this->trackingData =
$trackingData
;
100
}
101
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel
Definition:
ParcelTrackingDataModel.php:23
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\__construct
__construct(?string $parcelId=null, ?TrackingData $trackingData=null)
Definition:
ParcelTrackingDataModel.php:40
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\getParcelId
getParcelId()
Definition:
ParcelTrackingDataModel.php:52
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\$parcelId
$parcelId
Definition:
ParcelTrackingDataModel.php:28
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\$trackingData
$trackingData
Definition:
ParcelTrackingDataModel.php:34
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\setParcelId
setParcelId(?string $parcelId)
Definition:
ParcelTrackingDataModel.php:89
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\setTrackingData
setTrackingData(?TrackingData $trackingData)
Definition:
ParcelTrackingDataModel.php:97
Commercetools\Import\Models\OrderPatches\ParcelTrackingDataModel\getTrackingData
getTrackingData()
Definition:
ParcelTrackingDataModel.php:70
Commercetools\Import\Models\Orders\TrackingDataModel
Definition:
TrackingDataModel.php:21
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\OrderPatches\ParcelTrackingData
Definition:
ParcelTrackingData.php:16
Commercetools\Import\Models\Orders\TrackingData
Definition:
TrackingData.php:15
Commercetools\Import\Models\OrderPatches
Definition:
DeliveryAddressDraft.php:9
Generated by
1.9.1