Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | 2 | * @param $ids |
|
33 | */ |
||
34 | 2 | public function detachAll(HasAsset&Model $model, ?string $type = null): void |
|
|
|||
35 | 1 | { |
|
36 | 1 | $query = DB::table('asset_pivots') |
|
37 | ->where('entity_type', $model->getMorphClass()) |
||
38 | 1 | ->where('entity_id', (string) $model->getKey()); |
|
39 | |||
40 | 2 | if($type) { |
|
41 | $query->where('type', $type); |
||
56 |