Skip to content

Forgotten conflict #7894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Then, define a service for this class:
# app/config/services.yml
services:
# ...

AppBundle\Service\FileUploader:
arguments:
$targetDir: '%brochures_directory%'
Expand Down Expand Up @@ -414,28 +414,15 @@ Now, register this class as a Doctrine listener:

// app/config/services.php
use AppBundle\EventListener\BrochureUploaderListener;
<<<<<<< HEAD
use Symfony\Component\DependencyInjection\Reference;

// ...
$container->register('app.doctrine_brochure_listener', BrochureUploaderListener::class)
->addArgument(new Reference('brochures_directory'))
=======

$container->autowire(BrochureUploaderListener::class)
>>>>>>> 8974c4842... Going through more chapters to use types and autowiring
->addTag('doctrine.event_listener', array(
'event' => 'prePersist',
))
->addTag('doctrine.event_listener', array(
<<<<<<< HEAD
'event' => 'prePersist',
));
=======
'event' => 'preUpdate',
))
;
>>>>>>> 8974c4842... Going through more chapters to use types and autowiring

This listener is now automatically executed when persisting a new Product
entity. This way, you can remove everything related to uploading from the
Expand Down