开发者

update instead of delete

开发者 https://www.devze.com 2023-01-01 21:04 出处:网络
with cakephp, is it possible to have update sql action instead of delete (i would like to set some ki开发者_如何学JAVAnd of flag, so it \"looks\" like it is deleted)?

with cakephp, is it possible to have update sql action instead of delete (i would like to set some ki开发者_如何学JAVAnd of flag, so it "looks" like it is deleted)?

tnx in adv!!!


It's easy enough using callbacks. A less manual approach, though, would be to grab the SoftDeletable behavior and tweak it to meet any special needs you may have.


Just create an delete / disable kind of column and update the same on delete, you would need to put condition delete / disable true for all find queries

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号