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

[CRUD - DELETE] - The PRE_DELETE event should be able to cancel removing #52

Open
mcsky opened this issue Nov 28, 2019 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mcsky
Copy link
Contributor

mcsky commented Nov 28, 2019

Biig\Melodiia\Crud\Controller\Delete
image

For the moment nothing is done to be able to cancel the removing of the resource, but it could be useful for some domain reasons.

Create a new type of event (PreDeleteEvent?) accepting these methods:

  • cancelDelete(): void
  • isDeletion(): boolean
  • delete(): void

The last listener which calls cancel or delete takes the way on other previous.
If isDeletion() return false, the call to $this->dataStore->remove($data) should be avoided.

@mcsky mcsky added enhancement New feature or request good first issue Good for newcomers labels Nov 28, 2019
Nek- added a commit to Nek-/Melodiia that referenced this issue Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant