Kyl*_*yle 6 symfony doctrine-orm
我想传入Doctrine Entity Manager,这样我就可以访问我的存储库等,但是我遇到了一些麻烦.
我的服务定义如下:
mlbp_beer.rest.controller:
    class: MLBP\BeerBundle\Controller\RestController
    arguments: 
      em: "@doctrine.orm.entity_manager" 
这给了我一个错误:
ParameterNotFoundException: The service "mlbp_beer.rest.controller" has a dependency on a non-existent parameter "doctrine.orm.entity_manager".
谢谢您的帮助!
看起来对吗?确保在你的routing.yml中定义了rest,就像这样..也清除缓存!
rest:
    resource: mlbp_beer.rest.controller
    type:     rest