I found the lifecycle events I have declared for my doctrine entities are 
not getting called in the context of a console command (under symfony 
v2.1.7). They work perfectly fine when the operation happens in a web 
contoller.  

Is it possible doctrine events are not registered for console commands ? 

It looks like events are generally not bound for console commands: 
is https://github.com/symfony/symfony/issues/1929
There even is a pull request, but it doesn't look like this is going to get 
merged into a production branch any time 
soon: https://github.com/symfony/symfony/pull/3889

I need those events e.g. to set some defaults for associated entities and 
queue external processes. I've thought about doing moving the command code 
into a web controller but some of the use cases are batch processing where 
we require longer runtime and more memour than on the web frontend. 

How can I register the doctrine event manager for commands ?


-- 
-- 
If you want to report a vulnerability issue on Symfony, please read the 
procedure on http://symfony.com/security

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
--- 
You received this message because you are subscribed to the Google Groups 
"Symfony developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to