commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
FacetRangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class FacetRangeModel extends JsonObjectModel implements FacetRange
21{
26 protected $from;
27
32 protected $fromStr;
33
38 protected $to;
39
44 protected $toStr;
45
50 protected $count;
51
56 protected $productCount;
57
62 protected $total;
63
68 protected $min;
69
74 protected $max;
75
80 protected $mean;
81
82
86 public function __construct(
87 ?float $from = null,
88 ?string $fromStr = null,
89 ?float $to = null,
90 ?string $toStr = null,
91 ?int $count = null,
92 ?int $productCount = null,
93 ?float $total = null,
94 ?float $min = null,
95 ?float $max = null,
96 ?float $mean = null
97 ) {
98 $this->from = $from;
99 $this->fromStr = $fromStr;
100 $this->to = $to;
101 $this->toStr = $toStr;
102 $this->count = $count;
103 $this->productCount = $productCount;
104 $this->total = $total;
105 $this->min = $min;
106 $this->max = $max;
107 $this->mean = $mean;
108 }
109
117 public function getFrom()
118 {
119 if (is_null($this->from)) {
121 $data = $this->raw(self::FIELD_FROM);
122 if (is_null($data)) {
123 return null;
124 }
125 $this->from = (float) $data;
126 }
127
128 return $this->from;
129 }
130
138 public function getFromStr()
139 {
140 if (is_null($this->fromStr)) {
142 $data = $this->raw(self::FIELD_FROM_STR);
143 if (is_null($data)) {
144 return null;
145 }
146 $this->fromStr = (string) $data;
147 }
148
149 return $this->fromStr;
150 }
151
159 public function getTo()
160 {
161 if (is_null($this->to)) {
163 $data = $this->raw(self::FIELD_TO);
164 if (is_null($data)) {
165 return null;
166 }
167 $this->to = (float) $data;
168 }
169
170 return $this->to;
171 }
172
180 public function getToStr()
181 {
182 if (is_null($this->toStr)) {
184 $data = $this->raw(self::FIELD_TO_STR);
185 if (is_null($data)) {
186 return null;
187 }
188 $this->toStr = (string) $data;
189 }
190
191 return $this->toStr;
192 }
193
200 public function getCount()
201 {
202 if (is_null($this->count)) {
204 $data = $this->raw(self::FIELD_COUNT);
205 if (is_null($data)) {
206 return null;
207 }
208 $this->count = (int) $data;
209 }
210
211 return $this->count;
212 }
213
221 public function getProductCount()
222 {
223 if (is_null($this->productCount)) {
225 $data = $this->raw(self::FIELD_PRODUCT_COUNT);
226 if (is_null($data)) {
227 return null;
228 }
229 $this->productCount = (int) $data;
230 }
231
232 return $this->productCount;
233 }
234
241 public function getTotal()
242 {
243 if (is_null($this->total)) {
245 $data = $this->raw(self::FIELD_TOTAL);
246 if (is_null($data)) {
247 return null;
248 }
249 $this->total = (float) $data;
250 }
251
252 return $this->total;
253 }
254
261 public function getMin()
262 {
263 if (is_null($this->min)) {
265 $data = $this->raw(self::FIELD_MIN);
266 if (is_null($data)) {
267 return null;
268 }
269 $this->min = (float) $data;
270 }
271
272 return $this->min;
273 }
274
281 public function getMax()
282 {
283 if (is_null($this->max)) {
285 $data = $this->raw(self::FIELD_MAX);
286 if (is_null($data)) {
287 return null;
288 }
289 $this->max = (float) $data;
290 }
291
292 return $this->max;
293 }
294
301 public function getMean()
302 {
303 if (is_null($this->mean)) {
305 $data = $this->raw(self::FIELD_MEAN);
306 if (is_null($data)) {
307 return null;
308 }
309 $this->mean = (float) $data;
310 }
311
312 return $this->mean;
313 }
314
315
319 public function setFrom(?float $from): void
320 {
321 $this->from = $from;
322 }
323
327 public function setFromStr(?string $fromStr): void
328 {
329 $this->fromStr = $fromStr;
330 }
331
335 public function setTo(?float $to): void
336 {
337 $this->to = $to;
338 }
339
343 public function setToStr(?string $toStr): void
344 {
345 $this->toStr = $toStr;
346 }
347
351 public function setCount(?int $count): void
352 {
353 $this->count = $count;
354 }
355
359 public function setProductCount(?int $productCount): void
360 {
361 $this->productCount = $productCount;
362 }
363
367 public function setTotal(?float $total): void
368 {
369 $this->total = $total;
370 }
371
375 public function setMin(?float $min): void
376 {
377 $this->min = $min;
378 }
379
383 public function setMax(?float $max): void
384 {
385 $this->max = $max;
386 }
387
391 public function setMean(?float $mean): void
392 {
393 $this->mean = $mean;
394 }
395}
__construct(?float $from=null, ?string $fromStr=null, ?float $to=null, ?string $toStr=null, ?int $count=null, ?int $productCount=null, ?float $total=null, ?float $min=null, ?float $max=null, ?float $mean=null)