WhereNotIn::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace OkayBueno\Repositories\Criteria\Eloquent;
4
5
use OkayBueno\Repositories\Criteria\CriteriaInterface;
6
7
/**
8
 * Class WhereNotIn
9
 * @package OkayBueno\Repositories\Criteria\Eloquent
10
 */
11
class WhereNotIn implements CriteriaInterface
12
{
13
    protected $field = NULL;
14
    protected $list = [];
15
16
    /**
17
     * WhereIn constructor.
18
     * @param $field
19
     * @param array $list
20
     */
21
    public function __construct( $field, array $list )
22
    {
23
        $this->field = $field;
24
        $this->list = $list;
25
    }
26
27
    /**
28
     * @param mixed $queryBuilder
29
     * @return mixed
30
     */
31
    public function apply( $queryBuilder )
32
    {
33
        // Do something with the query builder and return it.
34
        return $queryBuilder->whereNotIn( $this->field, $this->list );
35
    }
36
37
}
38