Skip to content

Commit

Permalink
Add auto search for annotation extension name
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Jan 14, 2018
1 parent 6adb732 commit f28011a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Kdyby/Doctrine/DI/OrmExtension.php
Expand Up @@ -622,8 +622,15 @@ protected function processMetadataDriver(Nette\DI\ServiceDefinition $metadataDri
}

if ($impl === self::ANNOTATION_DRIVER) {
$annotationExtensionName = self::ANNOTATION_DRIVER;
foreach ($this->compiler->getExtensions(AnnotationsExtension::class) as $annotationExtension) {
$annotationExtensionName = $annotationExtension->name;

break;
}

$driver->arguments = [
'@' . self::ANNOTATION_DRIVER . '.reader',
"@{$annotationExtensionName}.reader",
Nette\Utils\Arrays::flatten($driver->arguments)
];
}
Expand Down

0 comments on commit f28011a

Please sign in to comment.