Created
January 28, 2013 16:10
-
-
Save mmenozzi/4656793 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Recupera la entity da utilizzare per memorizzare l'intervista | |
* | |
* @param $interviewId | |
* @param \Doctrine\Common\Persistence\ObjectManager $em | |
* @return object | |
*/ | |
public function findEntity($interviewId, ObjectManager $em) | |
{ | |
$repositoryMap = array( | |
'Application' => 'CharlieRecruitmentBundle:Application', | |
'AdditionalInformation' => 'CharlieUserBundle:AdditionalInformation', | |
); | |
list($entity, $entityId) = explode('-', $interviewId); | |
return $em->getRepository($repositoryMap[$entity]) | |
->find($entityId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment