Test Setup Failed
Push — 0.9 ( 705e7e...705c74 )
by Ben
03:28
created

UpdateAssetData::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Thinktomorrow\AssetLibrary\Application;
4
5
use Thinktomorrow\AssetLibrary\Asset;
6
use Thinktomorrow\AssetLibrary\HasAsset;
7
8
class UpdateAssetData
9
{
10
    public function handle(HasAsset $model, Asset $asset, string $type, string $locale, array $data): void
11
    {
12
        $model->assetRelation()
13
            ->where('id', $asset->id)
14
            ->where('type', $type)
15
            ->where('locale', $locale)
16
            ->update(['data' => $data]);
17
    }
18
}
19