commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
OrderPatches
DeliveryAddressDraftModel.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\Common\Address
;
16
use
Commercetools\Import\Models\Common\AddressModel
;
17
use stdClass;
18
22
final
class
DeliveryAddressDraftModel
extends
JsonObjectModel
implements
DeliveryAddressDraft
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
52
public
function
getDeliveryId
()
53
{
54
if
(is_null($this->deliveryId)) {
56
$data = $this->
raw
(self::FIELD_DELIVERY_ID);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
$this->deliveryId = (string) $data;
61
}
62
63
return
$this->deliveryId
;
64
}
65
70
public
function
getAddress
()
71
{
72
if
(is_null($this->address)) {
74
$data = $this->
raw
(self::FIELD_ADDRESS);
75
if
(is_null($data)) {
76
return
null
;
77
}
78
79
$this->address =
AddressModel::of
($data);
80
}
81
82
return
$this->address
;
83
}
84
85
89
public
function
setDeliveryId
(?
string
$deliveryId
): void
90
{
91
$this->deliveryId =
$deliveryId
;
92
}
93
97
public
function
setAddress
(?
Address
$address
): void
98
{
99
$this->address =
$address
;
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\Common\AddressModel
Definition:
AddressModel.php:23
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel
Definition:
DeliveryAddressDraftModel.php:23
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\setAddress
setAddress(?Address $address)
Definition:
DeliveryAddressDraftModel.php:97
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\getAddress
getAddress()
Definition:
DeliveryAddressDraftModel.php:70
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\__construct
__construct(?string $deliveryId=null, ?Address $address=null)
Definition:
DeliveryAddressDraftModel.php:40
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\$deliveryId
$deliveryId
Definition:
DeliveryAddressDraftModel.php:28
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\setDeliveryId
setDeliveryId(?string $deliveryId)
Definition:
DeliveryAddressDraftModel.php:89
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\getDeliveryId
getDeliveryId()
Definition:
DeliveryAddressDraftModel.php:52
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraftModel\$address
$address
Definition:
DeliveryAddressDraftModel.php:34
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\Address
Definition:
Address.php:16
Commercetools\Import\Models\OrderPatches\DeliveryAddressDraft
Definition:
DeliveryAddressDraft.php:16
Commercetools\Import\Models\OrderPatches
Definition:
DeliveryAddressDraft.php:9
Generated by
1.9.1