|
4 | 4 |
|
5 | 5 | use Doctrine\Common\Annotations\AnnotationException;
|
6 | 6 | use Doctrine\Common\Annotations\AnnotationReader;
|
7 |
| -use Doctrine\ORM\Event\OnFlushEventArgs; |
8 |
| -use Snowcap\CoreBundle\Util\String; |
9 |
| -use Symfony\Component\HttpFoundation\File\File; |
10 | 7 | use Doctrine\Common\EventSubscriber;
|
11 | 8 | use Doctrine\ORM\EntityManager;
|
12 | 9 | use Doctrine\ORM\Event\LifecycleEventArgs;
|
13 | 10 | use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
|
| 11 | +use Doctrine\ORM\Event\OnFlushEventArgs; |
14 | 12 | use Doctrine\ORM\Event\PreFlushEventArgs;
|
15 | 13 | use Doctrine\ORM\Events;
|
16 |
| - |
17 | 14 | use Snowcap\CoreBundle\File\CondemnedFile;
|
| 15 | +use Snowcap\CoreBundle\Util\StringUtil; |
| 16 | +use Symfony\Component\HttpFoundation\File\File; |
18 | 17 | use Symfony\Component\PropertyAccess\PropertyAccess;
|
19 | 18 |
|
| 19 | +/** |
| 20 | + * Class FileSubscriber |
| 21 | + * @package Snowcap\CoreBundle\Listener |
| 22 | + */ |
20 | 23 | class FileSubscriber implements EventSubscriber
|
21 | 24 | {
|
22 | 25 | /**
|
@@ -62,7 +65,7 @@ public function getSubscribedEvents()
|
62 | 65 |
|
63 | 66 | /**
|
64 | 67 | * @param \Doctrine\ORM\Event\LoadClassMetadataEventArgs $eventArgs
|
65 |
| - * @throws \UnexpectedValueException |
| 68 | + * @throws AnnotationException |
66 | 69 | */
|
67 | 70 | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
|
68 | 71 | {
|
@@ -346,7 +349,7 @@ private function generateFileName($fileEntity, array $fileConfig)
|
346 | 349 | if ($fileConfig['nameCallback'] !== null) {
|
347 | 350 | $accessor = PropertyAccess::createPropertyAccessor();
|
348 | 351 | $filename = $accessor->getValue($fileEntity, $fileConfig['nameCallback']);
|
349 |
| - $filename = String::slugify($filename); |
| 352 | + $filename = StringUtil::slugify($filename); |
350 | 353 |
|
351 | 354 | /*
|
352 | 355 | * Here we add a uniqid at the end of the filename to avoid any cache issue
|
|
0 commit comments