Skip to content

Commit 15af5b5

Browse files
dunglasostrolucky
authored andcommitted
fix: Doctrine ORM 3 support
1 parent 15d8552 commit 15af5b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

DependencyInjection/DoctrineExtension.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Doctrine\ORM\EntityManagerInterface;
2020
use Doctrine\ORM\Id\AbstractIdGenerator;
2121
use Doctrine\ORM\Proxy\Autoloader;
22+
use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand;
23+
use Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand;
2224
use Doctrine\ORM\UnitOfWork;
2325
use LogicException;
2426
use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension;
@@ -460,6 +462,15 @@ protected function ormLoad(array $config, ContainerBuilder $container)
460462
$container->removeDefinition('doctrine.uuid_generator');
461463
}
462464

465+
// not available in Doctrine ORM 3.0 and higher
466+
if (! class_exists(ConvertMappingCommand::class)) {
467+
$container->removeDefinition('doctrine.mapping_convert_command');
468+
}
469+
470+
if (! class_exists(EnsureProductionSettingsCommand::class)) {
471+
$container->removeDefinition('doctrine.ensure_production_settings_command');
472+
}
473+
463474
$entityManagers = [];
464475
foreach (array_keys($config['entity_managers']) as $name) {
465476
$entityManagers[$name] = sprintf('doctrine.orm.%s_entity_manager', $name);

0 commit comments

Comments
 (0)