commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MultiBuyLineItemsTargetBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
27  private $predicate;
28 
33  private $triggerQuantity;
34 
39  private $discountedQuantity;
40 
45  private $maxOccurrence;
46 
51  private $selectionMode;
52 
59  public function getPredicate()
60  {
61  return $this->predicate;
62  }
63 
70  public function getTriggerQuantity()
71  {
72  return $this->triggerQuantity;
73  }
74 
82  public function getDiscountedQuantity()
83  {
84  return $this->discountedQuantity;
85  }
86 
94  public function getMaxOccurrence()
95  {
96  return $this->maxOccurrence;
97  }
98 
105  public function getSelectionMode()
106  {
107  return $this->selectionMode;
108  }
109 
114  public function withPredicate(?string $predicate)
115  {
116  $this->predicate = $predicate;
117 
118  return $this;
119  }
120 
125  public function withTriggerQuantity(?int $triggerQuantity)
126  {
127  $this->triggerQuantity = $triggerQuantity;
128 
129  return $this;
130  }
131 
136  public function withDiscountedQuantity(?int $discountedQuantity)
137  {
138  $this->discountedQuantity = $discountedQuantity;
139 
140  return $this;
141  }
142 
147  public function withMaxOccurrence(?int $maxOccurrence)
148  {
149  $this->maxOccurrence = $maxOccurrence;
150 
151  return $this;
152  }
153 
158  public function withSelectionMode(?string $selectionMode)
159  {
160  $this->selectionMode = $selectionMode;
161 
162  return $this;
163  }
164 
165 
166  public function build(): MultiBuyLineItemsTarget
167  {
168  return new MultiBuyLineItemsTargetModel(
169  $this->predicate,
170  $this->triggerQuantity,
171  $this->discountedQuantity,
172  $this->maxOccurrence,
173  $this->selectionMode
174  );
175  }
176 
177  public static function of(): MultiBuyLineItemsTargetBuilder
178  {
179  return new self();
180  }
181 }