UserNotificationBuilder::whereType()   A
last analyzed

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 as EloquentModel;
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 EloquentModel|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
     * @return $this
27
     */
28
    public function whereType(string $type, string $operator = '=', string $boolean = 'and')
29
    {
30
        $this->where('type', $operator, $type, $boolean);
31
32
        return $this;
33
    }
34
}
35