Skip to content

Commit

Permalink
[DoctrineBundle] remove doctrine.event_subscriber tag and replace by …
Browse files Browse the repository at this point in the history
…doctrine.event_listener tag (#1650)
  • Loading branch information
alli83 committed Apr 26, 2023
1 parent 2a1d973 commit af1df78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion DependencyInjection/DoctrineExtension.php
Expand Up @@ -20,6 +20,7 @@
use Doctrine\ORM\Configuration as OrmConfiguration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Events;
use Doctrine\ORM\Id\AbstractIdGenerator;
use Doctrine\ORM\Proxy\Autoloader;
use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand;
Expand Down Expand Up @@ -554,7 +555,9 @@ protected function ormLoad(array $config, ContainerBuilder $container)
]);
}

$def->addTag('doctrine.event_subscriber');
$def
->addTag('doctrine.event_listener', ['event' => Events::loadClassMetadata])
->addTag('doctrine.event_listener', ['event' => Events::onClassMetadataNotFound]);
}

$container->registerForAutoconfiguration(ServiceEntityRepositoryInterface::class)
Expand Down
Expand Up @@ -890,7 +890,7 @@ public function testResolveTargetEntity(): void

$tags = $definition->getTags();
unset($tags['container.no_preload']);
$this->assertEquals(['doctrine.event_subscriber' => [[]]], $tags);
$this->assertEquals(['doctrine.event_listener' => [['event' => 'loadClassMetadata'], ['event' => 'onClassMetadataNotFound']]], $tags);
}

public function testSchemaIgnoreClasses(): void
Expand Down

0 comments on commit af1df78

Please sign in to comment.