commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Cart
CartSetEstimatedDeliveryActionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
CartSetEstimatedDeliveryActionModel
extends
JsonObjectModel
implements
CartSetEstimatedDeliveryAction
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'setEstimatedDelivery'
;
27
protected
$action
;
28
33
protected
$shippingKey
;
34
39
protected
$estimatedDelivery
;
40
41
45
public
function
__construct
(
46
?
string
$shippingKey
=
null
,
47
?
EstimatedDelivery
$estimatedDelivery
=
null
,
48
?
string
$action
=
null
49
) {
50
$this->shippingKey =
$shippingKey
;
51
$this->estimatedDelivery =
$estimatedDelivery
;
52
$this->action =
$action
??
self::DISCRIMINATOR_VALUE
;
53
}
54
59
public
function
getAction
()
60
{
61
if
(is_null($this->action)) {
63
$data = $this->
raw
(self::FIELD_ACTION);
64
if
(is_null($data)) {
65
return
null
;
66
}
67
$this->action = (string) $data;
68
}
69
70
return
$this->action
;
71
}
72
81
public
function
getShippingKey
()
82
{
83
if
(is_null($this->shippingKey)) {
85
$data = $this->
raw
(self::FIELD_SHIPPING_KEY);
86
if
(is_null($data)) {
87
return
null
;
88
}
89
$this->shippingKey = (string) $data;
90
}
91
92
return
$this->shippingKey
;
93
}
94
101
public
function
getEstimatedDelivery
()
102
{
103
if
(is_null($this->estimatedDelivery)) {
105
$data = $this->
raw
(self::FIELD_ESTIMATED_DELIVERY);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
110
$this->estimatedDelivery =
EstimatedDeliveryModel::of
($data);
111
}
112
113
return
$this->estimatedDelivery
;
114
}
115
116
120
public
function
setShippingKey
(?
string
$shippingKey
): void
121
{
122
$this->shippingKey =
$shippingKey
;
123
}
124
128
public
function
setEstimatedDelivery
(?
EstimatedDelivery
$estimatedDelivery
): void
129
{
130
$this->estimatedDelivery =
$estimatedDelivery
;
131
}
132
}
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel
Definition
CartSetEstimatedDeliveryActionModel.php:21
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\$action
$action
Definition
CartSetEstimatedDeliveryActionModel.php:27
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\$estimatedDelivery
$estimatedDelivery
Definition
CartSetEstimatedDeliveryActionModel.php:39
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\getShippingKey
getShippingKey()
Definition
CartSetEstimatedDeliveryActionModel.php:81
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\setShippingKey
setShippingKey(?string $shippingKey)
Definition
CartSetEstimatedDeliveryActionModel.php:120
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\__construct
__construct(?string $shippingKey=null, ?EstimatedDelivery $estimatedDelivery=null, ?string $action=null)
Definition
CartSetEstimatedDeliveryActionModel.php:45
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\getAction
getAction()
Definition
CartSetEstimatedDeliveryActionModel.php:59
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\setEstimatedDelivery
setEstimatedDelivery(?EstimatedDelivery $estimatedDelivery)
Definition
CartSetEstimatedDeliveryActionModel.php:128
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
CartSetEstimatedDeliveryActionModel.php:22
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\getEstimatedDelivery
getEstimatedDelivery()
Definition
CartSetEstimatedDeliveryActionModel.php:101
Commercetools\Api\Models\Cart\CartSetEstimatedDeliveryActionModel\$shippingKey
$shippingKey
Definition
CartSetEstimatedDeliveryActionModel.php:33
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\CartSetEstimatedDeliveryAction
Definition
CartSetEstimatedDeliveryAction.php:15
Commercetools\Api\Models\Cart\EstimatedDelivery
Definition
EstimatedDelivery.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition
AbsoluteAllocation.php:9
Generated by
1.9.8