diff --git a/DependencyInjection/Compiler/IntegrationPass.php b/DependencyInjection/Compiler/IntegrationPass.php index d879e39..fd508db 100644 --- a/DependencyInjection/Compiler/IntegrationPass.php +++ b/DependencyInjection/Compiler/IntegrationPass.php @@ -47,6 +47,12 @@ private function integrateWithDoctrine(ContainerBuilder $container) return; } + // Can't support Doctrine/ORM older (< 2.4) version. + $reflection = new \ReflectionClass('Doctrine\ORM\Configuration'); + if (!$reflection->hasMethod('setRepositoryFactory')) { + return; + } + $entityManagerNames = array_keys($container->getParameter('doctrine.entity_managers')); foreach ($entityManagerNames as $emName) { diff --git a/composer.json b/composer.json index beeb94a..9ecf4cf 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "sensio/framework-extra-bundle": "~2.0|~3.0", "jms/security-extra-bundle": "~1.0", "doctrine/doctrine-bundle": "~1.5", - "doctrine/orm": "~2.3", + "doctrine/orm": "~2.4", "phpcollection/phpcollection": ">=0.2,<0.3-dev", "symfony/phpunit-bridge": "~3.3", "phpunit/phpunit": "^4.8.35|^5.4.4|^6.0.0",