Open rkmax opened 10 years ago
Yes, confirmed.
I may be misunderstanding your issue, but have you tried setting the variable to public? If I understand correctly, this bundle has it's own code for injecting into controller classes, but other services are done through Symfony, and Symfony does not allow private variables to have a service unless you inject it through a method. You can do it on public variables. In controllers, because this bundle handles it, it takes appropriate action and you can inject on private variables.
@hoshsadiq the idea is to try all 3 injection methods available, property injection and injection in through the method and the command just does not work
@InjectParams on the constructor also doesn't work for Symfony2 Command subclasses. Related?
I have the same issue, doesn't matter if the property is private, protected or public
I have a Command (non-controller class) i'm traying to inject a doctrine mongo odm service
i've tried booth methods (independently) and when i execute the command i get the error
Call to a member function xxxxx() on a non-object
Only works the Constructor/Setter Injection