Skip to content

Commit

Permalink
Added the support of namespace alias in getManagerForClass
Browse files Browse the repository at this point in the history
  • Loading branch information
stof authored and beberlei committed Jul 29, 2012
1 parent 4a1d5e6 commit 0e073d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ public function getManager($name = null)
*/
public function getManagerForClass($class)
{
// Check for namespace alias
if (strpos($class, ':') !== false) {
list($namespaceAlias, $simpleClassName) = explode(':', $class);
$class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
}

$proxyClass = new \ReflectionClass($class);
if ($proxyClass->implementsInterface($this->proxyInterfaceName)) {
$class = $proxyClass->getParentClass()->getName();
Expand Down

0 comments on commit 0e073d6

Please sign in to comment.