Skip to content

Commit b59e181

Browse files
committed
Merge branch 'master' of github.com:mevdschee/php-crud-api
2 parents 67ac9da + 65f052a commit b59e181

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ $api = new PHP_CRUD_API(array(
9191
'tenancy_function'=>function($cmd,$db,$tab,$col) { return null; },
9292
'input_sanitizer'=>function($cmd,$db,$tab,$col,$typ,$val) { return $val; },
9393
'input_validator'=>function($cmd,$db,$tab,$col,$typ,$val,$ctx) { return true; },
94-
'before'=>function($cmd,$db,$tab,$id,$in) { /* adjust array $in */ },
94+
'before'=>function(&$cmd,&$db,&$tab,&$id,&$in) { /* adjust array $in */ },
9595
'after'=>function($cmd,$db,$tab,$id,$in,$out) { /* do something */ },
9696
// configurable options
9797
'allow_origin'=>'*',
@@ -762,6 +762,10 @@ PUT http://localhost/api.php/categories/2
762762
Before any operation the 'before' function is called that allows you to do set some automatic fields.
763763
Note that the 'inputs' parameter is writable and is an array. The array may contain NULL values on invalid JSON.
764764

765+
## Soft delete
766+
767+
The 'before' function allows modification of the request parameters and can (for instance) be used to implement soft delete behavior.
768+
765769
## Custom actions
766770

767771
After any operation the 'after' function is called that allows you to do some custom actions.

0 commit comments

Comments
 (0)