by prettyscripts on 2010-05-21 10:39:38
in most of the projects i work on, when 'deleting' a record, it's preferred to mark it as deleted than actually deleting the record. this makes re-instating a record easier. the common practice is to add a status field to every record.
in doctrine, this can be done with SoftDelete.
when defined, a column 'deleted_at' is automatically created to the table. when deleting the record, this field is automatically updated to the current timestamp.
in schema.yml:
Code:
MyTable: | |
actAs: | |
SoftDelete: ~ | |
columns: | |
..... |
i wish i had discovered this earlier! it really saves my coding time!