commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
OrderLineItemDiscountSetMessagePayloadModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
28 public const DISCRIMINATOR_VALUE = 'OrderLineItemDiscountSet';
33 protected $type;
34
39 protected $lineItemId;
40
45 protected $lineItemKey;
46
52
57 protected $totalPrice;
58
63 protected $taxedPrice;
64
70
71
75 public function __construct(
76 ?string $lineItemId = null,
77 ?string $lineItemKey = null,
82 ?string $type = null
83 ) {
84 $this->lineItemId = $lineItemId;
85 $this->lineItemKey = $lineItemKey;
86 $this->discountedPricePerQuantity = $discountedPricePerQuantity;
87 $this->totalPrice = $totalPrice;
88 $this->taxedPrice = $taxedPrice;
89 $this->taxedPricePortions = $taxedPricePortions;
90 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
91 }
92
97 public function getType()
98 {
99 if (is_null($this->type)) {
101 $data = $this->raw(self::FIELD_TYPE);
102 if (is_null($data)) {
103 return null;
104 }
105 $this->type = (string) $data;
106 }
107
108 return $this->type;
109 }
110
117 public function getLineItemId()
118 {
119 if (is_null($this->lineItemId)) {
121 $data = $this->raw(self::FIELD_LINE_ITEM_ID);
122 if (is_null($data)) {
123 return null;
124 }
125 $this->lineItemId = (string) $data;
126 }
127
128 return $this->lineItemId;
129 }
130
137 public function getLineItemKey()
138 {
139 if (is_null($this->lineItemKey)) {
141 $data = $this->raw(self::FIELD_LINE_ITEM_KEY);
142 if (is_null($data)) {
143 return null;
144 }
145 $this->lineItemKey = (string) $data;
146 }
147
148 return $this->lineItemKey;
149 }
150
158 {
159 if (is_null($this->discountedPricePerQuantity)) {
161 $data = $this->raw(self::FIELD_DISCOUNTED_PRICE_PER_QUANTITY);
162 if (is_null($data)) {
163 return null;
164 }
165 $this->discountedPricePerQuantity = DiscountedLineItemPriceForQuantityCollection::fromArray($data);
166 }
167
169 }
170
177 public function getTotalPrice()
178 {
179 if (is_null($this->totalPrice)) {
181 $data = $this->raw(self::FIELD_TOTAL_PRICE);
182 if (is_null($data)) {
183 return null;
184 }
185
186 $this->totalPrice = CentPrecisionMoneyModel::of($data);
187 }
188
189 return $this->totalPrice;
190 }
191
198 public function getTaxedPrice()
199 {
200 if (is_null($this->taxedPrice)) {
202 $data = $this->raw(self::FIELD_TAXED_PRICE);
203 if (is_null($data)) {
204 return null;
205 }
206
207 $this->taxedPrice = TaxedItemPriceModel::of($data);
208 }
209
210 return $this->taxedPrice;
211 }
212
220 public function getTaxedPricePortions()
221 {
222 if (is_null($this->taxedPricePortions)) {
224 $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS);
225 if (is_null($data)) {
226 return null;
227 }
228 $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data);
229 }
230
232 }
233
234
238 public function setLineItemId(?string $lineItemId): void
239 {
240 $this->lineItemId = $lineItemId;
241 }
242
246 public function setLineItemKey(?string $lineItemKey): void
247 {
248 $this->lineItemKey = $lineItemKey;
249 }
250
258
263 {
264 $this->totalPrice = $totalPrice;
265 }
266
271 {
272 $this->taxedPrice = $taxedPrice;
273 }
274
279 {
280 $this->taxedPricePortions = $taxedPricePortions;
281 }
282}
__construct(?string $lineItemId=null, ?string $lineItemKey=null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity=null, ?CentPrecisionMoney $totalPrice=null, ?TaxedItemPrice $taxedPrice=null, ?MethodTaxedPriceCollection $taxedPricePortions=null, ?string $type=null)
setDiscountedPricePerQuantity(?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity)