commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
MultiBuyLineItemsTargetModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
22 public const DISCRIMINATOR_VALUE = 'multiBuyLineItems';
27 protected $type;
28
33 protected $predicate;
34
40
46
51 protected $maxOccurrence;
52
57 protected $selectionMode;
58
59
63 public function __construct(
64 ?string $predicate = null,
65 ?int $triggerQuantity = null,
66 ?int $discountedQuantity = null,
67 ?int $maxOccurrence = null,
68 ?string $selectionMode = null,
69 ?string $type = null
70 ) {
71 $this->predicate = $predicate;
72 $this->triggerQuantity = $triggerQuantity;
73 $this->discountedQuantity = $discountedQuantity;
74 $this->maxOccurrence = $maxOccurrence;
75 $this->selectionMode = $selectionMode;
76 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
77 }
78
83 public function getType()
84 {
85 if (is_null($this->type)) {
87 $data = $this->raw(self::FIELD_TYPE);
88 if (is_null($data)) {
89 return null;
90 }
91 $this->type = (string) $data;
92 }
93
94 return $this->type;
95 }
96
103 public function getPredicate()
104 {
105 if (is_null($this->predicate)) {
107 $data = $this->raw(self::FIELD_PREDICATE);
108 if (is_null($data)) {
109 return null;
110 }
111 $this->predicate = (string) $data;
112 }
113
114 return $this->predicate;
115 }
116
123 public function getTriggerQuantity()
124 {
125 if (is_null($this->triggerQuantity)) {
127 $data = $this->raw(self::FIELD_TRIGGER_QUANTITY);
128 if (is_null($data)) {
129 return null;
130 }
131 $this->triggerQuantity = (int) $data;
132 }
133
135 }
136
144 public function getDiscountedQuantity()
145 {
146 if (is_null($this->discountedQuantity)) {
148 $data = $this->raw(self::FIELD_DISCOUNTED_QUANTITY);
149 if (is_null($data)) {
150 return null;
151 }
152 $this->discountedQuantity = (int) $data;
153 }
154
156 }
157
165 public function getMaxOccurrence()
166 {
167 if (is_null($this->maxOccurrence)) {
169 $data = $this->raw(self::FIELD_MAX_OCCURRENCE);
170 if (is_null($data)) {
171 return null;
172 }
173 $this->maxOccurrence = (int) $data;
174 }
175
177 }
178
185 public function getSelectionMode()
186 {
187 if (is_null($this->selectionMode)) {
189 $data = $this->raw(self::FIELD_SELECTION_MODE);
190 if (is_null($data)) {
191 return null;
192 }
193 $this->selectionMode = (string) $data;
194 }
195
197 }
198
199
203 public function setPredicate(?string $predicate): void
204 {
205 $this->predicate = $predicate;
206 }
207
211 public function setTriggerQuantity(?int $triggerQuantity): void
212 {
213 $this->triggerQuantity = $triggerQuantity;
214 }
215
219 public function setDiscountedQuantity(?int $discountedQuantity): void
220 {
221 $this->discountedQuantity = $discountedQuantity;
222 }
223
227 public function setMaxOccurrence(?int $maxOccurrence): void
228 {
229 $this->maxOccurrence = $maxOccurrence;
230 }
231
235 public function setSelectionMode(?string $selectionMode): void
236 {
237 $this->selectionMode = $selectionMode;
238 }
239}
__construct(?string $predicate=null, ?int $triggerQuantity=null, ?int $discountedQuantity=null, ?int $maxOccurrence=null, ?string $selectionMode=null, ?string $type=null)