commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DeliveryAddressSetMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'DeliveryAddressSet';
29  protected $type;
30 
35  protected $deliveryId;
36 
41  protected $address;
42 
47  protected $oldAddress;
48 
53  protected $shippingKey;
54 
55 
59  public function __construct(
60  ?string $deliveryId = null,
61  ?Address $address = null,
62  ?Address $oldAddress = null,
63  ?string $shippingKey = null,
64  ?string $type = null
65  ) {
66  $this->deliveryId = $deliveryId;
67  $this->address = $address;
68  $this->oldAddress = $oldAddress;
69  $this->shippingKey = $shippingKey;
70  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
71  }
72 
77  public function getType()
78  {
79  if (is_null($this->type)) {
81  $data = $this->raw(self::FIELD_TYPE);
82  if (is_null($data)) {
83  return null;
84  }
85  $this->type = (string) $data;
86  }
87 
88  return $this->type;
89  }
90 
97  public function getDeliveryId()
98  {
99  if (is_null($this->deliveryId)) {
101  $data = $this->raw(self::FIELD_DELIVERY_ID);
102  if (is_null($data)) {
103  return null;
104  }
105  $this->deliveryId = (string) $data;
106  }
107 
108  return $this->deliveryId;
109  }
110 
117  public function getAddress()
118  {
119  if (is_null($this->address)) {
121  $data = $this->raw(self::FIELD_ADDRESS);
122  if (is_null($data)) {
123  return null;
124  }
125 
126  $this->address = AddressModel::of($data);
127  }
128 
129  return $this->address;
130  }
131 
138  public function getOldAddress()
139  {
140  if (is_null($this->oldAddress)) {
142  $data = $this->raw(self::FIELD_OLD_ADDRESS);
143  if (is_null($data)) {
144  return null;
145  }
146 
147  $this->oldAddress = AddressModel::of($data);
148  }
149 
150  return $this->oldAddress;
151  }
152 
159  public function getShippingKey()
160  {
161  if (is_null($this->shippingKey)) {
163  $data = $this->raw(self::FIELD_SHIPPING_KEY);
164  if (is_null($data)) {
165  return null;
166  }
167  $this->shippingKey = (string) $data;
168  }
169 
170  return $this->shippingKey;
171  }
172 
173 
177  public function setDeliveryId(?string $deliveryId): void
178  {
179  $this->deliveryId = $deliveryId;
180  }
181 
185  public function setAddress(?Address $address): void
186  {
187  $this->address = $address;
188  }
189 
193  public function setOldAddress(?Address $oldAddress): void
194  {
195  $this->oldAddress = $oldAddress;
196  }
197 
201  public function setShippingKey(?string $shippingKey): void
202  {
203  $this->shippingKey = $shippingKey;
204  }
205 }
__construct(?string $deliveryId=null, ?Address $address=null, ?Address $oldAddress=null, ?string $shippingKey=null, ?string $type=null)