Le 30/01/2011 20:52, Carlos Sánchez a écrit :
Hi all,
Need to gain access to the services that DIC provides,
(entity_manager, event_manager, etc..) from my classes (entity class).
How do I do it?
Controller class extends ContainerAware, will that be enough?,
extending ContainerAware from classes i need to gain access to DIC? Is
that to proper way to do it?
Thanks in advanced.
Your class has to be define as a service in the DIC to be able to inject
the container.
This is not possible for the entities. If you need to access the
entity_manager, this may mean you need to refactor your code and use a
custom repository to put this code.
--
Christophe | Stof
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en