soft delete

hi, my name is claude. i’m a thrid year student. i was giving a system to create and the framework that i’m using is Yii. the system is about risk assessment. all the system is working but i’m having a problem with the soft delete option. for the system, we needeed to create a matrix, the matrix was created and now they want us to soft delete the matrix instead of deleting the all matrix. now, when you delete the matrix, it deleting everything even from the database. i’m asking for any help.i’ve been googling, research but i can’t find anything…and they yii documentation, doesn’t says anything about it.

What do you mean by soft delete? removing it from the matrix but not from the Database?

I think Claude is writing about possibility to make an UNDO of deletion, as GMAIL does. Ex.: "5 items have been deleted. Undo" where "Undo" is a link to restore all previous deleted items in the table.

One technique for soft delete is adding a "deleted" column to the table(s). Then set this attribute to true when it should be deleted.

Scopes is also useful for this. You can create a default scope that returns only non-deleted rows from the database.