Skip to content

Commit

Permalink
Register extensions on symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 3, 2024
1 parent e1aa0fc commit 8e711c2
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions src/Bridge/Symfony/Resources/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Doctrine\ORM\Events;
use Nucleos\Doctrine\EventListener\ORM\ConfirmableListener;
use Nucleos\Doctrine\EventListener\ORM\DeletableListener;
use Nucleos\Doctrine\EventListener\ORM\LifecycleDateListener;
Expand All @@ -22,28 +23,61 @@
$container->services()

->set(ConfirmableListener::class)
->tag('doctrine.event_subscriber')
->tag('doctrine.event_listener', [
'event' => Events::loadClassMetadata,
])

->set(DeletableListener::class)
->tag('doctrine.event_subscriber')
->tag('doctrine.event_listener', [
'event' => Events::loadClassMetadata,
])

->set(LifecycleDateListener::class)
->tag('doctrine.event_subscriber')
->tag('doctrine.event_listener', [
'event' => Events::prePersist,
])
->tag('doctrine.event_listener', [
'event' => Events::preUpdate,
])
->tag('doctrine.event_listener', [
'event' => Events::loadClassMetadata,
])

->set(SortableListener::class)
->tag('doctrine.event_subscriber')
->tag('doctrine.event_listener', [
'event' => Events::prePersist,
])
->tag('doctrine.event_listener', [
'event' => Events::preUpdate,
])
->tag('doctrine.event_listener', [
'event' => Events::preRemove,
])
->tag('doctrine.event_listener', [
'event' => Events::loadClassMetadata,
])
->args([
new Reference('property_accessor'),
])

->set(UniqueActiveListener::class)
->tag('doctrine.event_subscriber')
->tag('doctrine.event_listener', [
'event' => Events::prePersist,
])
->tag('doctrine.event_listener', [
'event' => Events::preUpdate,
])
->tag('doctrine.event_listener', [
'event' => Events::loadClassMetadata,
])
->args([
new Reference('property_accessor'),
])

->set(TablePrefixEventListener::class)
->tag('doctrine.event_subscriber')
->tag('doctrine.event_listener', [
'event' => Events::loadClassMetadata,
])
->args([
new Parameter('nucleos_doctrine.table.prefix'),
])
Expand Down

0 comments on commit 8e711c2

Please sign in to comment.