Total Complexity | 4 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | class RoleBuilder extends QueryBuilder |
||
8 | { |
||
9 | /** |
||
10 | * Scope Role query to roles of a particular type. |
||
11 | * |
||
12 | * @param string $type |
||
13 | * @param string $operator |
||
14 | * @param string $boolean |
||
15 | * |
||
16 | * @return $this |
||
17 | */ |
||
18 | public function whereType(string $type, string $operator = '=', string $boolean = 'and') |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Scope Role query to only 'user' type roles. |
||
27 | * |
||
28 | * @param string $operator |
||
29 | * @param string $boolean |
||
30 | * |
||
31 | * @return $this |
||
32 | */ |
||
33 | public function whereTypeUser(string $operator = '=', string $boolean = 'and') |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Scope query results to Role's matching a role 'name'. |
||
42 | * |
||
43 | * @param string $name |
||
44 | * @param string $operator |
||
45 | * @param string $boolean |
||
46 | * @return $this |
||
47 | */ |
||
48 | public function whereName(string $name, string $operator = '=', string $boolean = 'and'): self |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Scope query results to Role's that do NOT have a particular role 'name'. |
||
57 | * |
||
58 | * @param string $name |
||
59 | * @param string $boolean |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function whereNotName(string $name, string $boolean = 'and'): self |
||
68 |