commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
DiscountedLineItemPriceDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $value;
30 
35  private $includedDiscounts;
36 
41  public function getValue()
42  {
43  return $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value;
44  }
45 
50  public function getIncludedDiscounts()
51  {
52  return $this->includedDiscounts;
53  }
54 
59  public function withValue(?Money $value)
60  {
61  $this->value = $value;
62 
63  return $this;
64  }
65 
70  public function withIncludedDiscounts(?DiscountedLineItemPortionCollection $includedDiscounts)
71  {
72  $this->includedDiscounts = $includedDiscounts;
73 
74  return $this;
75  }
76 
81  public function withValueBuilder(?MoneyBuilder $value)
82  {
83  $this->value = $value;
84 
85  return $this;
86  }
87 
89  {
91  $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value,
92  $this->includedDiscounts
93  );
94  }
95 
96  public static function of(): DiscountedLineItemPriceDraftBuilder
97  {
98  return new self();
99  }
100 }
withIncludedDiscounts(?DiscountedLineItemPortionCollection $includedDiscounts)