Passed
Push — master ( 4a474d...df1b75 )
by Stephen
02:14
created

UserNotificationBuilder::whereType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 3
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Sfneal\Users\Builders;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Sfneal\Builders\QueryBuilder;
7
use Sfneal\Users\Builders\Interfaces\WhereUserInterface;
8
use Sfneal\Users\Builders\Traits\WhereUser;
9
use Sfneal\Users\Models\UserNotification;
10
11
class UserNotificationBuilder extends QueryBuilder implements WhereUserInterface
12
{
13
    use WhereUser;
14
15
    /**
16
     * @var Model|UserNotification
17
     */
18
    protected $targetModel = UserNotification::class;
19
20
    /**
21
     * Scope Query to UserNotification's of a certain 'type'.
22
     *
23
     * @param string $type
24
     * @param string $operator
25
     * @param string $boolean
26
     *
27
     * @return $this
28
     */
29
    public function whereType(string $type, string $operator = '=', string $boolean = 'and')
30
    {
31
        $this->where('type', $operator, $type, $boolean);
32
33
        return $this;
34
    }
35
}
36