1 | <?php |
||
2 | /** |
||
3 | * Created by enea dhack - 29/12/2019 12:24. |
||
4 | */ |
||
5 | |||
6 | namespace Vaened\Searcher\Constraints; |
||
7 | |||
8 | use Illuminate\Database\Eloquent\Builder; |
||
9 | use Vaened\Searcher\Constraint; |
||
10 | use Vaened\Searcher\Rangeable; |
||
11 | |||
12 | class Between implements Constraint |
||
13 | { |
||
14 | private Rangeable $range; |
||
15 | |||
16 | private string $column; |
||
17 | |||
18 | public function __construct(Rangeable $range, string $column) |
||
19 | { |
||
20 | $this->range = $range; |
||
21 | $this->column = $column; |
||
22 | } |
||
23 | |||
24 | public function condition(Builder $builder): Builder |
||
25 | { |
||
26 | return $builder->whereBetween($this->column, $this->range->getRange()); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
27 | } |
||
28 | } |
||
29 |