Le 12/05/2011 12:11, Valera a écrit :
Unfortunately, this does not completely solve the problem.
It appears that I'm adding a listener (which indirectly depends on
doctrine.orm.entity_manager) and am injecting AuditService into it;
also I have the AuditService depending on the
doctrine.orm.entity_manager so a circular referencing occurs.
Probably having multiple entity managers will help here.
Any other advice?
you cannot do a circular reference.
so if your service has a dependency to the entity manager, a solution is
to inject the container so that you can retrieve the entity manager when
you need to use it instead of doing it when you build the service.
The other solution is to put the logic using the entity manager in the
doctrine listener itself as the LifecycleEventArgs object passed to the
listener gives access to the entity manager.
--
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 users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en