| @@ 9-34 (lines=26) @@ | ||
| 6 | ||
| 7 | use Psi\Component\Grid\FilterDataInterface; |
|
| 8 | ||
| 9 | class NumberFilterData implements FilterDataInterface |
|
| 10 | { |
|
| 11 | private $comparator; |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | public function __construct(string $comparator = null, $value = null) |
|
| 15 | { |
|
| 16 | $this->comparator = $comparator; |
|
| 17 | $this->value = $value; |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getComparator() |
|
| 21 | { |
|
| 22 | return $this->comparator; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getValue() |
|
| 26 | { |
|
| 27 | return $this->value; |
|
| 28 | } |
|
| 29 | ||
| 30 | public function isApplicable(): bool |
|
| 31 | { |
|
| 32 | return null !== $this->value; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 9-34 (lines=26) @@ | ||
| 6 | ||
| 7 | use Psi\Component\Grid\FilterDataInterface; |
|
| 8 | ||
| 9 | class StringFilterData implements FilterDataInterface |
|
| 10 | { |
|
| 11 | private $comparator; |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | public function __construct(string $comparator = null, string $value = null) |
|
| 15 | { |
|
| 16 | $this->comparator = $comparator; |
|
| 17 | $this->value = $value; |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getComparator() |
|
| 21 | { |
|
| 22 | return $this->comparator; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getValue() |
|
| 26 | { |
|
| 27 | return $this->value; |
|
| 28 | } |
|
| 29 | ||
| 30 | public function isApplicable(): bool |
|
| 31 | { |
|
| 32 | return null !== $this->value; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||