Hi Marco Thanks for your response. Symfony currently requires Doctrine ORM ~2.2,>=2.2.3,<2.5 so that would explain why it's not working for me.
Any idea if there are any downsides to upgrading ORM to 2.5 on Symfony? Alternatively, any idea if I can resolve the repository in version 2.2.*? Sam On Tuesday, June 23, 2015 at 6:36:03 PM UTC+1, Marco Pivetta wrote: > > This should work in ORM 2.5 > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > On 23 June 2015 at 19:21, Sam Hastings <[email protected] <javascript:>> > wrote: > >> I've set up a ResolveTargetEntityListener to resolve >> *MyBundle\Model\ProductInterface* to *AnotherBundle\Entity\Product* at >> runtime. >> >> All my association mappings with the interface name have worked just fine. >> >> However I need to find a way of resolving this association at runtime, so >> I can a) access the repository from the interface name; and b) create new >> instances of the entity from the interface name. >> >> When I try using the following code in my Symfony controller, I'm getting >> a *“class 'MyBundle\Model\ProductInterface' does not exist”* exception. >> >> $this->getDoctrine()->getRepository('MyBundle\Model\ProductInterface'); >> >> What do I have to do to enable this kind of call? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "doctrine-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/doctrine-user. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
