bug #23385 [DoctrineBridge] Fix resetting entity managers with case sensitive 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
-------

9737bcc024 [DoctrineBridge] Use normalizedIds for resetting entity manager services
This commit is contained in:
Fabien Potencier 2017-07-05 09:55:44 +03:00
commit bef2142071

View File

@ -53,7 +53,10 @@ abstract class ManagerRegistry extends AbstractManagerRegistry implements Contai
}
$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];