Commit 70922c6
authored
Possible fix for issue 206
Possible fix for [issue 206](#206)
soft delete example
```php
'before'=>function(&$cmd, &$db, &$tab, &$id, &$in) {
if ($cmd == 'delete') {
$cmd = 'update'; // change command to update
foreach($in as $k => $o) {
$in[$k]->deleted = date('Y-m-d H:i:s', time());
}
}
},
'column_authorizer'=>function($cmd, $db ,$tab, $col) {
return ( ! in_array($col, array('deleted')));
},
'record_filter'=>function($cmd,$db,$tab) {
return array('deleted,is,null');
}
```1 parent 0da7a62 commit 70922c6
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1879 | 1879 | | |
1880 | 1880 | | |
1881 | 1881 | | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | 1882 | | |
1886 | 1883 | | |
1887 | 1884 | | |
| |||
2635 | 2632 | | |
2636 | 2633 | | |
2637 | 2634 | | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
2638 | 2643 | | |
2639 | 2644 | | |
2640 | 2645 | | |
| |||
0 commit comments