File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App\Repositories\Criteria;
4
+
5
+ use LaraRepo\Contracts\RepositoryInterface;
6
+ use LaraRepo\Criteria\Criteria;
7
+
8
+ /**
9
+ * Class WhereNotCriteria
10
+ * @package App\Repositories\Criteria
11
+ */
12
+ class WhereNotInCriteria extends Criteria
13
+ {
14
+ /**
15
+ * @var
16
+ */
17
+ protected $column;
18
+
19
+ /**
20
+ * @var
21
+ */
22
+ protected $values;
23
+
24
+ /**
25
+ * WhereNotInCriteria constructor.
26
+ * @param $column
27
+ * @param $values
28
+ */
29
+ public function __construct($column, $values)
30
+ {
31
+ $this->column = $column;
32
+ $this->values = (array) $values;
33
+ }
34
+
35
+ /**
36
+ * @param $modelQuery
37
+ * @param RepositoryInterface $repository
38
+ * @return mixed
39
+ */
40
+ public function apply($modelQuery, RepositoryInterface $repository)
41
+ {
42
+ return $modelQuery->whereNotIn($this->column, $this->values);
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments