Can't enable SoftDeleteable in Symfony2 - Unre

2019-06-22 08:59发布

I'm having problems trying to activate the SoftDeleteable filter in StofDoctrineExtensionsBundle. I configured it as described in the manual:

# app/config/config.yml
doctrine:
    orm:
        entity_managers:
            default:
                filters:
                    softdeleteable:
                        class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                        enabled: true

But this is what I get:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "filters" under "doctrine.orm.entity_managers.default"

Running bin/vendors update didn't help. What could be wrong?

2条回答
三岁会撩人
2楼-- · 2019-06-22 09:48

You can just do it yourself, it is not hard, saving you from installing another bundle:

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/filters.html

查看更多
看我几分像从前
3楼-- · 2019-06-22 09:55

First, using bin/vendors update is a bad idea because it sets all the vendors to their latest versions. You should use bin/vendors install only.

Second, make sure you are using the 1.0.x branch of StofDoctrineExtensionsBundle, because the master branch is not compatible with Symfony 2.0.x.

查看更多
登录 后发表回答