Skip to content

Commit

Permalink
Merge pull request #44 from enumag/tag
Browse files Browse the repository at this point in the history
Added tags to all connections and entity managers
  • Loading branch information
fprochazka committed Sep 6, 2013
2 parents 32dd68e + fe1898b commit e5084e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Kdyby/Doctrine/DI/OrmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit e5084e5

Please sign in to comment.