php - Make use of a "deleted" column in CakePHP -


instead of deleting row on delete want update column called "deleted" time delete happened (and maybe set "deleteduserid" column). of course, on object->find operations want exclude deleted rows. possible or crazy?

you'll want use beforefind() model callback filter rows deleted=1. check $querydata['conditions'], appending $querydata['conditions']['model.deleted'] = 0 if 'model.deleted' or 'deleted' not set.

for more details, see http://book.cakephp.org/view/76/callback-methods.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -