@@ -39,10 +39,12 @@ |
||
39 | 39 | $fileType = explode('/', $file->getClientMimeType()); |
40 | 40 | $originalFilename = $file->getClientOriginalName(); |
41 | 41 | |
42 | - if ($file_id) |
|
43 | - $fileEntity = $this->em->getRepository(File::class)->find($file_id); |
|
44 | - if (!$fileEntity) |
|
45 | - $fileEntity = new File(); |
|
42 | + if ($file_id) { |
|
43 | + $fileEntity = $this->em->getRepository(File::class)->find($file_id); |
|
44 | + } |
|
45 | + if (!$fileEntity) { |
|
46 | + $fileEntity = new File(); |
|
47 | + } |
|
46 | 48 | |
47 | 49 | $fileEntity->setContext($context); |
48 | 50 | $fileEntity->setContent($content); |