Skip to content

Commit

Permalink
bug #23385 [DoctrineBridge] Fix resetting entity managers with case s…
Browse files Browse the repository at this point in the history
…ensitive id (chalasr)

This PR was merged into the 3.3 branch.

Discussion
----------

[DoctrineBridge] Fix resetting entity managers with case sensitive id

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

9737bcc [DoctrineBridge] Use normalizedIds for resetting entity manager services
  • Loading branch information
fabpot committed Jul 5, 2017
2 parents 5768424 + 9737bcc commit bef2142
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/Bridge/Doctrine/ManagerRegistry.php
Expand Up @@ -53,7 +53,10 @@ protected function resetService($name)
}
$manager->setProxyInitializer(\Closure::bind(
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
if (isset($this->aliases[$name = strtolower($name)])) {
if (isset($this->normalizedIds[$normalizedId = strtolower($name)])) {
$name = $this->normalizedIds[$normalizedId];
}
if (isset($this->aliases[$name])) {
$name = $this->aliases[$name];
}
$method = !isset($this->methodMap[$name]) ? 'get'.strtr($name, $this->underscoreMap).'Service' : $this->methodMap[$name];
Expand Down

0 comments on commit bef2142

Please sign in to comment.