commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DeliveryAddressDraftModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $deliveryId;
29
34 protected $address;
35
36
40 public function __construct(
41 ?string $deliveryId = null,
42 ?Address $address = null
43 ) {
44 $this->deliveryId = $deliveryId;
45 $this->address = $address;
46 }
47
54 public function getDeliveryId()
55 {
56 if (is_null($this->deliveryId)) {
58 $data = $this->raw(self::FIELD_DELIVERY_ID);
59 if (is_null($data)) {
60 return null;
61 }
62 $this->deliveryId = (string) $data;
63 }
64
65 return $this->deliveryId;
66 }
67
74 public function getAddress()
75 {
76 if (is_null($this->address)) {
78 $data = $this->raw(self::FIELD_ADDRESS);
79 if (is_null($data)) {
80 return null;
81 }
82
83 $this->address = AddressModel::of($data);
84 }
85
86 return $this->address;
87 }
88
89
93 public function setDeliveryId(?string $deliveryId): void
94 {
95 $this->deliveryId = $deliveryId;
96 }
97
101 public function setAddress(?Address $address): void
102 {
103 $this->address = $address;
104 }
105}