Re : Re: [symfony-devs] How get entity manager inside entity or twig extension

2011-07-22 Thread jaugustin
I am try to do the same thing, I know that's not a good idea inject some service into the Enty, but what would be the best practice for something like: having a collection of entity (nested set category) in a page which need to print the "path", in the repository we get anything to construct th

Re: [symfony-devs] How get entity manager inside entity or twig extension

2011-05-11 Thread ryan weaver
Hi there- What exactly are you trying to accomplish? I think Stof is right that this is probably better accomplished not in the way you're doing it (though it's of course possible to inject the entity manager into a Twig extension via the service container). Thanks! Ryan Weaver US Office Head &

Re: [symfony-devs] How get entity manager inside entity or twig extension

2011-05-11 Thread Christophe COEVOET
Le 09/05/2011 11:11, hd_deman a écrit : Hi, Im trying to get entity manager inside entity or twig extension. i want something like this in twig extension getChildren() as $i){ print $i->getTitle(); } ?> children($this); } ?> getting the entity manager in the entity goes agains