Skip to content
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

Add native soft-delete support #1054

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Add native soft-delete support #1054

wants to merge 2 commits into from

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Aug 18, 2022

replaces #692 and #1058 (issue #967)

@mvorisek mvorisek force-pushed the fix_soft_delete branch 2 times, most recently from 4b48362 to ed39520 Compare August 18, 2022 23:11
@mvorisek mvorisek force-pushed the fix_soft_delete branch 5 times, most recently from c4a5985 to 0734360 Compare September 1, 2022 20:51
$softDeleteController->softDelete($entity);

$entity->hook(Model::HOOK_AFTER_DELETE);
$entity->breakHook(false); // this will cancel original Model::delete()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an alternative could be to replace the persistence during update so the delete hook does not need to be broken

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both solutions are internal so we can go ahead in this way and add this feature.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, such changes can have effect on overrided delete method or user hooks, very important decision that needs literaly hours of very fine reasoning to decide this correctly.

@mvorisek mvorisek force-pushed the fix_soft_delete branch 2 times, most recently from 11d578d to 7bc5f99 Compare September 4, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants