Update instead of deleting

with cakephp, is it possible to update the sql action instead of delete (I would like to set some kind of flag, so it looks like it was deleted)?

tnx in adv !!!

+4
source share
2 answers

It is quite simple using callbacks. A less manual approach, however, would be to grab SoftDeletable and customize it to meet any special needs you may have.

+5
source

Just create a delete / disable column and update it when you delete, you will need to set the condition delete / disable true for all search requests

0
source

Source: https://habr.com/ru/post/1311714/


All Articles