commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Cart
CartSetBillingAddressActionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\Common\BaseAddress
;
12
use
Commercetools\Api\Models\Common\BaseAddressModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
CartSetBillingAddressActionModel
extends
JsonObjectModel
implements
CartSetBillingAddressAction
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'setBillingAddress'
;
29
protected
$action
;
30
35
protected
$address
;
36
37
41
public
function
__construct
(
42
?
BaseAddress
$address
=
null
,
43
?
string
$action
=
null
44
) {
45
$this->address =
$address
;
46
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
47
}
48
53
public
function
getAction
()
54
{
55
if
(is_null($this->action)) {
57
$data = $this->
raw
(self::FIELD_ACTION);
58
if
(is_null($data)) {
59
return
null
;
60
}
61
$this->action = (string) $data;
62
}
63
64
return
$this->action
;
65
}
66
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 =
BaseAddressModel::of
($data);
84
}
85
86
return
$this->address
;
87
}
88
89
93
public
function
setAddress
(?
BaseAddress
$address
): void
94
{
95
$this->address =
$address
;
96
}
97
}
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel
Definition:
CartSetBillingAddressActionModel.php:23
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
CartSetBillingAddressActionModel.php:24
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\$address
$address
Definition:
CartSetBillingAddressActionModel.php:35
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\getAction
getAction()
Definition:
CartSetBillingAddressActionModel.php:53
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\setAddress
setAddress(?BaseAddress $address)
Definition:
CartSetBillingAddressActionModel.php:93
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\getAddress
getAddress()
Definition:
CartSetBillingAddressActionModel.php:74
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\__construct
__construct(?BaseAddress $address=null, ?string $action=null)
Definition:
CartSetBillingAddressActionModel.php:41
Commercetools\Api\Models\Cart\CartSetBillingAddressActionModel\$action
$action
Definition:
CartSetBillingAddressActionModel.php:29
Commercetools\Api\Models\Common\BaseAddressModel
Definition:
BaseAddressModel.php:21
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\Api\Models\Cart\CartSetBillingAddressAction
Definition:
CartSetBillingAddressAction.php:16
Commercetools\Api\Models\Common\BaseAddress
Definition:
BaseAddress.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition:
Cart.php:9
Generated by
1.9.1