commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartSetEstimatedDeliveryActionModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'setEstimatedDelivery';
27 protected $action;
28
33 protected $shippingKey;
34
40
41
45 public function __construct(
46 ?string $shippingKey = 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
114 }
115
116
120 public function setShippingKey(?string $shippingKey): void
121 {
122 $this->shippingKey = $shippingKey;
123 }
124
129 {
130 $this->estimatedDelivery = $estimatedDelivery;
131 }
132}
__construct(?string $shippingKey=null, ?EstimatedDelivery $estimatedDelivery=null, ?string $action=null)