voryx / ThruwayBundle

Bundle for building Real-time Apps in Symfony
98 stars 47 forks source link

thruway and docrtine #68

Closed tortoisedoc closed 7 years ago

tortoisedoc commented 7 years ago

Perhaps this is a newbie question; how can i provide doctrine.orm.default_entity_manager via dependency injection to my class (for example as construct parameter)? I tried the default approach, as in to declare my class in the services.xml and provide it as argument, but the parameter mapping does not seem to be applied. In fact, in the cache, the object is created as clean (i.e. no parameters). My symfony version is 2.8.

tortoisedoc commented 7 years ago

Answered this myself; my class which exposes RPC calls should implement ContainerAwareInterface to get access to the container (and through that to everything else) via the setContainer class method

mbonneau commented 7 years ago

@tortoisedoc - Thanks for sharing the answer once you found it.