I want to pass in the Doctrine Entity Manager so I can access my repositories etc. but I'm having some trouble.
My service is defined:
mlbp_beer.rest.controller:
class: MLBP\BeerBundle\Controller\RestController
arguments:
em: "@doctrine.orm.entity_manager"
This gives me an error:
ParameterNotFoundException: The service "mlbp_beer.rest.controller" has a dependency on a non-existent parameter "doctrine.orm.entity_manager".
Thanks for the help!
That looks right? Make sure rest is defined in your routing.yml like so.. Clear the cache too!
rest:
resource: mlbp_beer.rest.controller
type: rest
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