Skip to content

Commit

Permalink
Added tags to all connections and entity managers
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag authored and fprochazka committed Sep 6, 2013
1 parent 54d787f commit aa25c84
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 @@ -281,6 +283,7 @@ protected function processEntityManager($name, array $defaults)
$connectionService = $this->processConnection($name, $defaults, $isDefault),
$this->prefix('@' . $name . '.ormConfiguration')
))
->addTag(self::TAG_ENTITY_MANAGER)
->setAutowired($isDefault);
}

Expand Down Expand Up @@ -329,6 +332,7 @@ protected function processConnection($name, array $defaults, $isDefault = FALSE)
3 => $dbalTypes,
$schemaTypes
))
->addTag(self::TAG_CONNECTION)
->setAutowired($isDefault);
/** @var Nette\DI\ServiceDefinition $connection */

Expand Down

0 comments on commit aa25c84

Please sign in to comment.