1

I'm trying to do a "soft-delete" for a symfony project. So i want to use StofDoctrineExtensionsBundle and i did :

stof_doctrine_extensions:
    orm:
        default:
            ...
            softdeleteable: true

doctrine:
    ...
    orm:
        filters:
            softdeleteable:
                class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                enabled: true

In my config.yml.

But now i have the error message:

Unrecognized option "softdeleteable" under "doctrine.orm.entity_managers.filters"

Matteo
  • 37,680
  • 11
  • 100
  • 115
Sylvain Attoumani
  • 1,213
  • 1
  • 15
  • 34
  • Did you complete step 2 of installation? https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html – Veas May 02 '17 at 12:57
  • @Veas I did and it says : ClassNotFoundException – Sylvain Attoumani May 02 '17 at 13:00
  • you need to configure the AppKernel adding the new BundleClass – Matteo May 02 '17 at 13:14
  • I just installed everything without any problem. Doublecheck everything, clear cache – Veas May 02 '17 at 13:19
  • 1
    @Matteo I did. May be i did something wrong. I just wrote : `new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),` in my AppKernel.php – Sylvain Attoumani May 02 '17 at 13:20
  • very strange. Double check if the file exists in `./vendor/stof/doctrine-extensions-bundle/StofDoctrineExtensionsBundle.php` in order to verify the composer installation was fine – Matteo May 02 '17 at 13:23
  • @Veas @Matteo i dont think it's normal but when i do `composer require stof/doctrine-extensions-bundle` i'v got error mssage - The requested package gedmo/doctrine-extensions (locked at v2.4.28, required as dev-master) is satisfiable by gedmo/doctrine-extensions[v2.4.28] but these conflict with your requirements or minimum-stability. – Sylvain Attoumani May 02 '17 at 13:23
  • oh exactly, the dependency of your project aren't good with the bundle, please post your `composer.json` file in order to debug the problem – Matteo May 02 '17 at 13:26
  • @Matteo the "require" part ? – Sylvain Attoumani May 02 '17 at 13:28
  • @Matteo it's done – Sylvain Attoumani May 02 '17 at 13:44

1 Answers1

2

in the error message you post seems you put the key filters under entity_managers key (as message says: under "doctrine.orm.entity_managers.filters"). fix moving the filters section under the orm key, as example:

doctrine:
    orm:
        filters:
            softdeleteable:
                class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                enabled: true

Hope this help

Matteo
  • 37,680
  • 11
  • 100
  • 115