Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
Remove | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
dependency | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
6 | |||
resolve | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Http\Helpers\ChangeManagement\ShortcutCategory; |
4 | |
5 | use App\Http\Helpers\ChangeManagement\ChangeManagement; |
6 | use App\Http\Models\Shortcut; |
7 | |
8 | class Remove extends ChangeManagement |
9 | { |
10 | public function dependency($id) |
11 | { |
12 | $shortcuts = Shortcut::where('category_id', $id)->count(); |
13 | |
14 | $hasDependency = false; |
15 | if ($shortcuts > 0) { |
16 | $hasDependency = true; |
17 | } |
18 | |
19 | return [ |
20 | 'has_dependency' => $hasDependency, |
21 | 'dependency' => [ |
22 | 'shortcuts' => $shortcuts, |
23 | ], |
24 | ]; |
25 | } |
26 | |
27 | public function resolve($id) |
28 | { |
29 | Shortcut::where('category_id', $id)->delete(); |
30 | } |
31 | } |