|
@@ -1862,6 +1862,19 @@ class PHP_CRUD_API {
|
1862
|
1862
|
$page = $this->processPageParameter($page);
|
1863
|
1863
|
$orderings = $this->processOrderingsParameter($orderings);
|
1864
|
1864
|
|
|
1865
|
+ // input
|
|
1866
|
+ $multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false);
|
|
1867
|
+ $inputs = $this->retrieveInputs($post);
|
|
1868
|
+ if ($before) {
|
|
1869
|
+ if ($action == 'delete' && $multi) {
|
|
1870
|
+ $inputs = array();
|
|
1871
|
+ for($i=1; $i <= count(explode(',', $key[0])); $i++) {
|
|
1872
|
+ $inputs[] = (object) array();
|
|
1873
|
+ }
|
|
1874
|
+ }
|
|
1875
|
+ $this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$inputs);
|
|
1876
|
+ }
|
|
1877
|
+
|
1865
|
1878
|
// reflection
|
1866
|
1879
|
list($tables,$collect,$select) = $this->findRelations($tables,$database,$auto_include);
|
1867
|
1880
|
$fields = $this->findFields($tables,$columns,$exclude,$select,$database);
|
|
@@ -1873,13 +1886,6 @@ class PHP_CRUD_API {
|
1873
|
1886
|
if ($tenancy_function) $this->applyTenancyFunction($tenancy_function,$action,$database,$fields,$filters);
|
1874
|
1887
|
if ($column_authorizer) $this->applyColumnAuthorizer($column_authorizer,$action,$database,$fields);
|
1875
|
1888
|
|
1876
|
|
- // input
|
1877
|
|
- $multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false);
|
1878
|
|
- $inputs = $this->retrieveInputs($post);
|
1879
|
|
- if ($before) {
|
1880
|
|
- $this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$inputs);
|
1881
|
|
- }
|
1882
|
|
-
|
1883
|
1889
|
foreach ($inputs as $k=>$context) {
|
1884
|
1890
|
$input = $this->filterInputByFields($context,$fields[$tables[0]]);
|
1885
|
1891
|
|