在自定义的类中使用Doctrine

使用的是doctrine的service注入的方法来实现:

  1. 在app/config/services.yml中定义如下
tron.send_weixin_message:
       class: Tron\LolBundle\Common\SendWeiXinMessage   //指定doctrine在什么地方使用
       arguments: ["@doctrine.orm.entity_manager"]      //传入service的名字

      2. 

posted @ 2015-11-29 12:08  S大好人S  阅读(133)  评论(0)    收藏  举报