0

I installed stof/DoctrineExtensions in my symfony app and configured everything as it should.

When I remove an entity, the deletedAt is set and everything works, but then when I do findAll the deleted entities are still returned.

  $zorgboer = $em->getRepository('stroPublicBundle:Zorgboerderij')->find(3);

  $em->remove($zorgboer);
  $em->flush();

  $zorgboeren = $em->getRepository('stroPublicBundle:Zorgboerderij')->findAll();

@EDIT: OK I found the solution. the problem was that entity Zorgboerderij extends another entity. The softdeletable had to be on the parent. Now it works

1
  • Is the filter added to your doctrine config? Commented Aug 22, 2014 at 10:06

1 Answer 1

1

Maybe you forgot to setup SoftDeleteableFilter in app/config.yml:

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

This will enable the SoftDeleteable filter, so entities which were "soft-deleted" will not appear in results.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.