Last active
October 13, 2015 01:28
-
-
Save leopro/4118053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getRepository($name) | |
{ | |
$em = $this->getEntityManager(); | |
$entity = $this->getExtendedEntity($name); | |
if (is_null($entity)) { | |
$entity = $this->getDefaultEntity($name); | |
} | |
if (is_null($entity)) { | |
throw new \RuntimeException(sprintf("The class %s was not found", $entity)); | |
} | |
return $this->doctrine->getRepository($entity, $em); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment