commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ParcelTrackingDataModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $parcelId;
29
34 protected $trackingData;
35
36
40 public function __construct(
41 ?string $parcelId = 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
83 }
84
85
89 public function setParcelId(?string $parcelId): void
90 {
91 $this->parcelId = $parcelId;
92 }
93
98 {
99 $this->trackingData = $trackingData;
100 }
101}
__construct(?string $parcelId=null, ?TrackingData $trackingData=null)