commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
RangeFacetResultModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
22  public const DISCRIMINATOR_VALUE = 'range';
27  protected $type;
28 
33  protected $ranges;
34 
35 
39  public function __construct(
41  ?string $type = null
42  ) {
43  $this->ranges = $ranges;
44  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
45  }
46 
51  public function getType()
52  {
53  if (is_null($this->type)) {
55  $data = $this->raw(self::FIELD_TYPE);
56  if (is_null($data)) {
57  return null;
58  }
59  $this->type = (string) $data;
60  }
61 
62  return $this->type;
63  }
64 
69  public function getRanges()
70  {
71  if (is_null($this->ranges)) {
73  $data = $this->raw(self::FIELD_RANGES);
74  if (is_null($data)) {
75  return null;
76  }
77  $this->ranges = FacetRangeCollection::fromArray($data);
78  }
79 
80  return $this->ranges;
81  }
82 
83 
87  public function setRanges(?FacetRangeCollection $ranges): void
88  {
89  $this->ranges = $ranges;
90  }
91 }
__construct(?FacetRangeCollection $ranges=null, ?string $type=null)