diff --git a/src/Kdyby/Doctrine/DI/OrmExtension.php b/src/Kdyby/Doctrine/DI/OrmExtension.php index f71d69cd..dcaf8e45 100644 --- a/src/Kdyby/Doctrine/DI/OrmExtension.php +++ b/src/Kdyby/Doctrine/DI/OrmExtension.php @@ -38,6 +38,8 @@ class OrmExtension extends Nette\DI\CompilerExtension const ANNOTATION_DRIVER = 'annotations'; const PHP_NAMESPACE = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\\\\]*'; + const TAG_CONNECTION = 'kdyby.doctrine.connection'; + const TAG_ENTITY_MANAGER = 'kdyby.doctrine.entityManager'; /** * @var array @@ -297,6 +299,7 @@ protected function processEntityManager($name, array $defaults) $connectionService = $this->processConnection($name, $defaults, $isDefault), $this->prefix('@' . $name . '.ormConfiguration') )) + ->addTag(self::TAG_ENTITY_MANAGER) ->setAutowired($isDefault) ->setInject(FALSE); } @@ -348,6 +351,7 @@ protected function processConnection($name, array $defaults, $isDefault = FALSE) 3 => $dbalTypes, $schemaTypes )) + ->addTag(self::TAG_CONNECTION) ->setAutowired($isDefault) ->setInject(FALSE); /** @var Nette\DI\ServiceDefinition $connection */