commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
CartRemoveLineItemActionBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use 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 
101  public function getExternalPrice()
102  {
103  return $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice;
104  }
105 
112  public function getExternalTotalPrice()
113  {
114  return $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice;
115  }
116 
123  public function getShippingDetailsToRemove()
124  {
125  return $this->shippingDetailsToRemove instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetailsToRemove->build() : $this->shippingDetailsToRemove;
126  }
127 
132  public function withLineItemId(?string $lineItemId)
133  {
134  $this->lineItemId = $lineItemId;
135 
136  return $this;
137  }
138 
143  public function withLineItemKey(?string $lineItemKey)
144  {
145  $this->lineItemKey = $lineItemKey;
146 
147  return $this;
148  }
149 
154  public function withQuantity(?int $quantity)
155  {
156  $this->quantity = $quantity;
157 
158  return $this;
159  }
160 
165  public function withExternalPrice(?Money $externalPrice)
166  {
167  $this->externalPrice = $externalPrice;
168 
169  return $this;
170  }
171 
176  public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice)
177  {
178  $this->externalTotalPrice = $externalTotalPrice;
179 
180  return $this;
181  }
182 
187  public function withShippingDetailsToRemove(?ItemShippingDetailsDraft $shippingDetailsToRemove)
188  {
189  $this->shippingDetailsToRemove = $shippingDetailsToRemove;
190 
191  return $this;
192  }
193 
198  public function withExternalPriceBuilder(?MoneyBuilder $externalPrice)
199  {
200  $this->externalPrice = $externalPrice;
201 
202  return $this;
203  }
204 
210  {
211  $this->externalTotalPrice = $externalTotalPrice;
212 
213  return $this;
214  }
215 
220  public function withShippingDetailsToRemoveBuilder(?ItemShippingDetailsDraftBuilder $shippingDetailsToRemove)
221  {
222  $this->shippingDetailsToRemove = $shippingDetailsToRemove;
223 
224  return $this;
225  }
226 
227  public function build(): CartRemoveLineItemAction
228  {
230  $this->lineItemId,
231  $this->lineItemKey,
232  $this->quantity,
233  $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice,
234  $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice,
235  $this->shippingDetailsToRemove instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetailsToRemove->build() : $this->shippingDetailsToRemove
236  );
237  }
238 
239  public static function of(): CartRemoveLineItemActionBuilder
240  {
241  return new self();
242  }
243 }
withShippingDetailsToRemoveBuilder(?ItemShippingDetailsDraftBuilder $shippingDetailsToRemove)
withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder $externalTotalPrice)
withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice)
withShippingDetailsToRemove(?ItemShippingDetailsDraft $shippingDetailsToRemove)