Total Complexity | 2 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
7 | class AddressBuilder extends QueryBuilder |
||
8 | { |
||
9 | /** |
||
10 | * Scope query results to Address's associated with a particular model. |
||
11 | * |
||
12 | * @param string $addressableType |
||
13 | * @param string $operator |
||
14 | * @param string $boolean |
||
15 | * @return $this |
||
16 | */ |
||
17 | public function whereType(string $addressableType, string $operator = '=', string $boolean = 'and'): self |
||
18 | { |
||
19 | $this->where('addressable_type', $operator, $addressableType, $boolean); |
||
20 | |||
21 | return $this; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Use a 'wildcard' like search to several attributes for a match. |
||
26 | * |
||
27 | * @param string $search |
||
28 | * @return $this |
||
29 | */ |
||
30 | public function whereAddressLike(string $search): self |
||
41 | } |
||
42 | } |
||
43 |