Skip to content

Instantly share code, notes, and snippets.

@mmenozzi
Created January 28, 2013 16:10
Show Gist options
  • Save mmenozzi/4656793 to your computer and use it in GitHub Desktop.
Save mmenozzi/4656793 to your computer and use it in GitHub Desktop.
/**
* 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