I have an entity called Container which depends on a service, DeviceService.
I currently inject it using an Entity Listener on postLoad. However this is not being injected when just creating the plain object new Container().
Should I create a ContainerFactory where I inject the service into the new object, along with the current listener, or do a smarter way exist in Symfony?
You can use Doctrine events. See : https://symfonycasts.com/screencast/api-platform-extending/post-load-listener
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With