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: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91:
<?php
namespace Apptus\ESales\Connector;
/**
* Represents a result having the facet_range format.
*/
class FacetRange implements Result, Facet {
private $min;
private $max;
private $minSelected;
private $maxSelected;
private $attribute;
/**
* FacetRange constructor.
* @param $min
* @param $max
* @param $minSelected
* @param $maxSelected
* @param $attribute
* @internal
*/
public function __construct($min, $max, $minSelected, $maxSelected, $attribute = null)
{
$this->min = $min;
$this->max = $max;
$this->minSelected = $minSelected;
$this->maxSelected = $maxSelected;
$this->attribute = $attribute;
}
/**
* The attribute value for the attribute.
* @return string the attribute value for the attribute
*/
public function getAttribute()
{
return $this->attribute == null ? "" : $this->attribute;
}
/**
* The isRange value for the attribute.
* @return boolean the isRange value for the attribute
*/
public function isRange(){
return true;
}
/**
* The minimum value for the attribute.
* @return string the minimum value for the attribute
*/
public function getMin()
{
return $this->min;
}
/**
* The maximum value for the attribute.
* @return string the maximum value for the attribute
*/
public function getMax()
{
return $this->max;
}
/**
* The selected minimum value. This is simply taken from the range that was provided to the panel through the facets
* argument. If no range was selected it will be the same value as returned by getMin().
* @return string the selected minimum value
*/
public function getMinSelected()
{
return $this->minSelected;
}
/**
* The selected maximum value. This is simply taken from the range that was provided to the panel through the facets
* argument. If no range was selected it will be the same value as returned by getMax().
* @return string the selected maximum value
*/
public function getMaxSelected()
{
return $this->maxSelected;
}
public function getType() {
return ResultType::FACET_RANGE;
}
}