commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CartRemoveLineItemActionBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $lineItemId;
30
35 private $lineItemKey;
36
41 private $quantity;
42
47 private $externalPrice;
48
53 private $externalTotalPrice;
54
59 private $shippingDetailsToRemove;
60
67 public function getLineItemId()
68 {
69 return $this->lineItemId;
70 }
71
78 public function getLineItemKey()
79 {
80 return $this->lineItemKey;
81 }
82
90 public function getQuantity()
91 {
92 return $this->quantity;
93 }
94
102 public function getExternalPrice()
103 {
104 return $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice;
105 }
106
113 public function getExternalTotalPrice()
114 {
115 return $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice;
116 }
117
125 {
126 return $this->shippingDetailsToRemove instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetailsToRemove->build() : $this->shippingDetailsToRemove;
127 }
128
133 public function withLineItemId(?string $lineItemId)
134 {
135 $this->lineItemId = $lineItemId;
136
137 return $this;
138 }
139
144 public function withLineItemKey(?string $lineItemKey)
145 {
146 $this->lineItemKey = $lineItemKey;
147
148 return $this;
149 }
150
155 public function withQuantity(?int $quantity)
156 {
157 $this->quantity = $quantity;
158
159 return $this;
160 }
161
166 public function withExternalPrice(?Money $externalPrice)
167 {
168 $this->externalPrice = $externalPrice;
169
170 return $this;
171 }
172
177 public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice)
178 {
179 $this->externalTotalPrice = $externalTotalPrice;
180
181 return $this;
182 }
183
188 public function withShippingDetailsToRemove(?ItemShippingDetailsDraft $shippingDetailsToRemove)
189 {
190 $this->shippingDetailsToRemove = $shippingDetailsToRemove;
191
192 return $this;
193 }
194
199 public function withExternalPriceBuilder(?MoneyBuilder $externalPrice)
200 {
201 $this->externalPrice = $externalPrice;
202
203 return $this;
204 }
205
211 {
212 $this->externalTotalPrice = $externalTotalPrice;
213
214 return $this;
215 }
216
222 {
223 $this->shippingDetailsToRemove = $shippingDetailsToRemove;
224
225 return $this;
226 }
227
229 {
231 $this->lineItemId,
232 $this->lineItemKey,
233 $this->quantity,
234 $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice,
235 $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice,
236 $this->shippingDetailsToRemove instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetailsToRemove->build() : $this->shippingDetailsToRemove
237 );
238 }
239
240 public static function of(): CartRemoveLineItemActionBuilder
241 {
242 return new self();
243 }
244}
withShippingDetailsToRemoveBuilder(?ItemShippingDetailsDraftBuilder $shippingDetailsToRemove)
withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder $externalTotalPrice)
withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice)
withShippingDetailsToRemove(?ItemShippingDetailsDraft $shippingDetailsToRemove)