1 | <?php namespace Distilleries\Expendable\Scopes; |
||
8 | class StatusScope implements Scope{ |
||
9 | |||
10 | /** |
||
11 | * All of the extensions to be added to the builder. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $extensions = ['WithOffline', 'OnlyOffline']; |
||
16 | |||
17 | |||
18 | /** |
||
19 | * Apply the scope to a given Eloquent query builder. |
||
20 | * |
||
21 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
22 | * @param \Illuminate\Database\Eloquent\Model $model |
||
23 | * @return void |
||
24 | */ |
||
25 | 300 | public function apply(Builder $builder, Model $model) |
|
34 | |||
35 | /** |
||
36 | * Extend the query builder with the needed functions. |
||
37 | * |
||
38 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
39 | * @return void |
||
40 | */ |
||
41 | 384 | public function extend(Builder $builder) |
|
49 | |||
50 | |||
51 | /** |
||
52 | * Add the with-trashed extension to the builder. |
||
53 | * |
||
54 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
55 | * @return void |
||
56 | */ |
||
57 | protected function addWithOffline(Builder $builder) |
||
64 | |||
65 | |||
66 | /** |
||
67 | * Add the only-trashed extension to the builder. |
||
68 | * |
||
69 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
70 | * @return void |
||
71 | */ |
||
72 | protected function addOnlyOffline(Builder $builder) |
||
84 | |||
85 | } |