commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
TrackingDataModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class TrackingDataModel extends JsonObjectModel implements TrackingData
21 {
26  protected $trackingId;
27 
32  protected $carrier;
33 
38  protected $provider;
39 
45 
50  protected $isReturn;
51 
52 
56  public function __construct(
57  ?string $trackingId = null,
58  ?string $carrier = null,
59  ?string $provider = null,
60  ?string $providerTransaction = null,
61  ?bool $isReturn = null
62  ) {
63  $this->trackingId = $trackingId;
64  $this->carrier = $carrier;
65  $this->provider = $provider;
66  $this->providerTransaction = $providerTransaction;
67  $this->isReturn = $isReturn;
68  }
69 
74  public function getTrackingId()
75  {
76  if (is_null($this->trackingId)) {
78  $data = $this->raw(self::FIELD_TRACKING_ID);
79  if (is_null($data)) {
80  return null;
81  }
82  $this->trackingId = (string) $data;
83  }
84 
85  return $this->trackingId;
86  }
87 
92  public function getCarrier()
93  {
94  if (is_null($this->carrier)) {
96  $data = $this->raw(self::FIELD_CARRIER);
97  if (is_null($data)) {
98  return null;
99  }
100  $this->carrier = (string) $data;
101  }
102 
103  return $this->carrier;
104  }
105 
110  public function getProvider()
111  {
112  if (is_null($this->provider)) {
114  $data = $this->raw(self::FIELD_PROVIDER);
115  if (is_null($data)) {
116  return null;
117  }
118  $this->provider = (string) $data;
119  }
120 
121  return $this->provider;
122  }
123 
128  public function getProviderTransaction()
129  {
130  if (is_null($this->providerTransaction)) {
132  $data = $this->raw(self::FIELD_PROVIDER_TRANSACTION);
133  if (is_null($data)) {
134  return null;
135  }
136  $this->providerTransaction = (string) $data;
137  }
138 
140  }
141 
146  public function getIsReturn()
147  {
148  if (is_null($this->isReturn)) {
150  $data = $this->raw(self::FIELD_IS_RETURN);
151  if (is_null($data)) {
152  return null;
153  }
154  $this->isReturn = (bool) $data;
155  }
156 
157  return $this->isReturn;
158  }
159 
160 
164  public function setTrackingId(?string $trackingId): void
165  {
166  $this->trackingId = $trackingId;
167  }
168 
172  public function setCarrier(?string $carrier): void
173  {
174  $this->carrier = $carrier;
175  }
176 
180  public function setProvider(?string $provider): void
181  {
182  $this->provider = $provider;
183  }
184 
188  public function setProviderTransaction(?string $providerTransaction): void
189  {
190  $this->providerTransaction = $providerTransaction;
191  }
192 
196  public function setIsReturn(?bool $isReturn): void
197  {
198  $this->isReturn = $isReturn;
199  }
200 }
__construct(?string $trackingId=null, ?string $carrier=null, ?string $provider=null, ?string $providerTransaction=null, ?bool $isReturn=null)