-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to really delete a softDeletable entity? #294
Comments
Quick 'n dirty:
|
@nifr : Thank you so much for your quick answer! This is just what I needed! |
@nifr I got the error "you have requested a non-existent service". After a quick search, I found the service in orm-services.yml and had to set "public: true" in order to get your solution to work. But this change will be lost after running composer, right? Can I make this change in a custom file somewhere else in my app so it's not lost after a composer update? |
2 possible solutions:
|
Maybe you can just overwrite the subscriber in your own services.yml? # app/config/services.yml
services:
knp.doctrine_behaviors.softdeletable_subscriber:
class: "%knp.doctrine_behaviors.softdeletable_subscriber.class%"
public: true
arguments:
- "@knp.doctrine_behaviors.reflection.class_analyzer"
- "%knp.doctrine_behaviors.reflection.is_recursive%"
- "%knp.doctrine_behaviors.softdeletable_subscriber.softdeletable_trait%"
tags:
- { name: doctrine.event_subscriber } |
Thanks for the tip! I'll give it a try when I can. |
The easiest trick to avoid any doctrine event listeners and "behaviours" is to use DQL:
|
Hi, I've been searching for a while but couldn't find a solution.
Is there a way (from a controller) to actually remove a softDeletable entity from the database?
Am I missing an existing feature?
Thanks.
The text was updated successfully, but these errors were encountered: