Conditions | 5 |
Paths | 5 |
Total Lines | 30 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function saved(Model $model): Model |
||
13 | { |
||
14 | $this->id = GenerateFileIdAction::make($model, $this->secureIdsMethod, $this->mode, $this->name)->run(); |
||
|
|||
15 | $this->uploaded = true; |
||
16 | |||
17 | if (isset($this->file)) { |
||
18 | if ($this->file == LARUPLOAD_NULL) { |
||
19 | $this->clean($this->id); |
||
20 | } |
||
21 | else { |
||
22 | if (!$this->keepOldFiles) { |
||
23 | $this->clean($this->id); |
||
24 | } |
||
25 | |||
26 | $this->setBasicDetails(); |
||
27 | $this->setMediaDetails(); |
||
28 | $this->uploadOriginalFile($this->id); |
||
29 | $this->setCover($this->id); |
||
30 | $this->handleStyles($this->id, $model); |
||
31 | } |
||
32 | |||
33 | $model = $this->setAttributes($model); |
||
34 | } |
||
35 | else if (isset($this->cover)) { |
||
36 | $this->setCover($this->id); |
||
37 | |||
38 | $model = $this->setAttributes($model); |
||
39 | } |
||
40 | |||
41 | return $model; |
||
42 | } |
||
51 |