我最近更新到 Symfony 2.7 并遇到了这个问题。它给了我这个弃用错误。
Symfony\Component\DependencyInjection\Definition::setFactoryMethod(getRepository) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead
Symfony\Component\DependencyInjection\Definition::setFactoryService(doctrine.orm.entity_manager) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead
似乎罪魁祸首是这种配置。
ac_queue.failed.job.repository:
class: Acme\Bundle\QueueBundle\Repository\FailedJob
factory_service: doctrine.orm.entity_manager
factory_method: getRepository
arguments: ['AcmeQueueBundle:FailedJob']
public: false
现在在 Symfony 2.7 中执行此操作的正确方法是什么?