Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
35 | public function mapToObject($file, $fileDto, array $context = []) |
||
36 | { |
||
37 | $fileEntity = FileSystemEntities::findFirst([ |
||
38 | 'conditions' => 'system_modules_id = ?0 AND entity_id = ?1 AND filesystem_id = ?2 AND companies_id = ?3 AND is_deleted = 0', |
||
39 | 'bind' => [$this->systemModuleId, $this->entityId, $file->getId(), $file->companies_id] |
||
40 | ]); |
||
41 | |||
42 | $fileDto->id = $fileEntity->getId(); |
||
43 | $fileDto->filesystem_id = $file->getId(); |
||
44 | $fileDto->name = $file->name; |
||
45 | $fileDto->field_name = $fileEntity ? $fileEntity->field_name : null; |
||
46 | $fileDto->url = $file->url; |
||
47 | $fileDto->size = $file->size; |
||
48 | $fileDto->file_type = $file->file_type; |
||
49 | $fileDto->attributes = $file->getAllSettings(); |
||
50 | |||
51 | return $fileDto; |
||
52 | } |
||
54 |