Skip to content

Commit a69e11e

Browse files
committed
Restore some more lines from v6 of the bridge
I am not sure how I messed this up, but I managed to omit these lines when copy/pasting from the diff I put at #2082 (comment)
1 parent 58fc28d commit a69e11e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/DependencyInjection/DoctrineExtension.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,22 @@ protected function registerMappingDrivers(array $objectManager, ContainerBuilder
302302
if ($container->hasDefinition($mappingService)) {
303303
$mappingDriverDef = $container->getDefinition($mappingService);
304304
$args = $mappingDriverDef->getArguments();
305-
if ($driverType === 'attribute') {
305+
if ($driverType === 'annotation') {
306306
$args[1] = array_merge(array_values($driverPaths), $args[1]);
307307
} else {
308308
$args[0] = array_merge(array_values($driverPaths), $args[0]);
309309
}
310310

311311
$mappingDriverDef->setArguments($args);
312+
} elseif ($driverType === 'attribute') {
313+
$mappingDriverDef = new Definition($this->getMetadataDriverClass($driverType), [
314+
array_values($driverPaths),
315+
]);
316+
} elseif ($driverType === 'annotation') {
317+
$mappingDriverDef = new Definition($this->getMetadataDriverClass($driverType), [
318+
new Reference($this->getObjectManagerElementName('metadata.annotation_reader')),
319+
array_values($driverPaths),
320+
]);
312321
} else {
313322
$mappingDriverDef = new Definition($this->getMetadataDriverClass($driverType), [
314323
array_values($driverPaths),

0 commit comments

Comments
 (0)