浏览代码

Merge branch 'master' of github.com:mevdschee/php-crud-api

Maurits van der Schee 8 年前
父节点
当前提交
b59e18163a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      README.md

+ 5
- 1
README.md 查看文件

@@ -91,7 +91,7 @@ $api = new PHP_CRUD_API(array(
91 91
 	'tenancy_function'=>function($cmd,$db,$tab,$col) { return null; },
92 92
 	'input_sanitizer'=>function($cmd,$db,$tab,$col,$typ,$val) { return $val; },
93 93
 	'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 */ },
95 95
 	'after'=>function($cmd,$db,$tab,$id,$in,$out) { /* do something */ },
96 96
 // configurable options
97 97
 	'allow_origin'=>'*',
@@ -762,6 +762,10 @@ PUT http://localhost/api.php/categories/2
762 762
 Before any operation the 'before' function is called that allows you to do set some automatic fields.
763 763
 Note that the 'inputs' parameter is writable and is an array. The array may contain NULL values on invalid JSON.
764 764
 
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
+
765 769
 ## Custom actions
766 770
 
767 771
 After any operation the 'after' function is called that allows you to do some custom actions.

正在加载...
取消
保存