Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace IQDEV\Search\Facet;
class FacetItemRange extends FacetItemType
{
/** range attributes */
private ?float $min = null, $max = null;
private ?float $selectedMin = null, $selectedMax = null;
/**
* @return array
*/
public function getFullRange(): array
{
return [
'min' => $this->min,
'max' => $this->max
];
}
/**
* @return array
*/
public function getSelectedRange(): array
{
return [
'min' => $this->selectedMin,
'max' => $this->selectedMax
];
}
public static function createFromRange(
?float $min,
?float $max,
int $count,
?float $selectedMin = null,
?float $selectedMax = null
): self {
$instance = new self();
$instance->count = $count;
$instance->min = $min;
$instance->max = $max;
$instance->selectedMin = $selectedMin;
$instance->selectedMax = $selectedMax;
return $instance;
}
}