无法在Symfony2中启用SoftDeleteable - 无法识别的选项"过滤器"

Kai*_*aja 5 symfony doctrine-orm

我在尝试激活StofDoctrineExtensionsBundle中的SoftDeleteable过滤器时遇到问题.我按照手册中的描述进行了配置:

# app/config/config.yml
doctrine:
    orm:
        entity_managers:
            default:
                filters:
                    softdeleteable:
                        class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                        enabled: true
Run Code Online (Sandbox Code Playgroud)

但这就是我得到的:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "filters" under "doctrine.orm.entity_managers.default"
Run Code Online (Sandbox Code Playgroud)

跑步bin/vendors update没有帮助.可能有什么不对?

Eln*_*mov 3

首先,使用bin/vendors update是一个坏主意,因为它将所有供应商设置为最新版本。你应该bin/vendors install只使用。

其次,确保您使用的1.0.x是 的分支StofDoctrineExtensionsBundle,因为该master分支与 Symfony 不兼容2.0.x