File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ Then, define a service for this class:
259
259
# app/config/services.yml
260
260
services :
261
261
# ...
262
-
262
+
263
263
AppBundle\Service\FileUploader :
264
264
arguments :
265
265
$targetDir : ' %brochures_directory%'
@@ -414,28 +414,15 @@ Now, register this class as a Doctrine listener:
414
414
415
415
// app/config/services.php
416
416
use AppBundle\EventListener\BrochureUploaderListener;
417
- <<<<<<< HEAD
418
- use Symfony\C omponent\D ependencyInjection\R eference;
419
-
420
- // ...
421
- $container->register('app.doctrine_brochure_listener', BrochureUploaderListener::class)
422
- ->addArgument(new Reference('brochures_directory'))
423
- =======
424
417
425
418
$container->autowire(BrochureUploaderListener::class)
426
- >>>>>>> 8974c4842... Going through more chapters to use types and autowiring
427
419
->addTag('doctrine.event_listener', array(
428
420
'event' => 'prePersist',
429
421
))
430
422
->addTag('doctrine.event_listener', array(
431
- <<<<<<< HEAD
432
- 'event' => 'prePersist',
433
- ));
434
- =======
435
423
'event' => 'preUpdate',
436
424
))
437
425
;
438
- >>>>>>> 8974c4842... Going through more chapters to use types and autowiring
439
426
440
427
This listener is now automatically executed when persisting a new Product
441
428
entity. This way, you can remove everything related to uploading from the
You can’t perform that action at this time.
0 commit comments