在自定义的类中使用Doctrine
使用的是doctrine的service注入的方法来实现:
- 在app/config/services.yml中定义如下
tron.send_weixin_message: class: Tron\LolBundle\Common\SendWeiXinMessage //指定doctrine在什么地方使用 arguments: ["@doctrine.orm.entity_manager"] //传入service的名字
2.
使用的是doctrine的service注入的方法来实现:
tron.send_weixin_message: class: Tron\LolBundle\Common\SendWeiXinMessage //指定doctrine在什么地方使用 arguments: ["@doctrine.orm.entity_manager"] //传入service的名字
2.