I have an Entity called Game with a related Repository called GameRepository:
/**
* @ORM\\Entity(repositoryClass=\"...\\GameReposi
you can inject the doctrine entity manager in your entity (using JMSDiExtraBundle) and have the repository like this:
/**
* @InjectParams({
* "em" = @Inject("doctrine.orm.entity_manager")
* })
*/
public function setInitialStatus(\Doctrine\ORM\EntityManager $em) {
$obj = $em->getRepository('AcmeSampleBundle:User')->functionInRepository();
//...
}
see this : http://jmsyst.com/bundles/JMSDiExtraBundle/1.1/annotations