Skip to content

Commit c05cb8d

Browse files
committed
cleanup construct
1 parent b91bd31 commit c05cb8d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

api.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,13 @@ protected function getParameters($settings) {
18621862
$page = $this->processPageParameter($page);
18631863
$orderings = $this->processOrderingsParameter($orderings);
18641864

1865+
// input
1866+
$multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false);
1867+
$inputs = $this->retrieveInputs($post);
1868+
if ($before) {
1869+
$this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$inputs);
1870+
}
1871+
18651872
// reflection
18661873
list($tables,$collect,$select) = $this->findRelations($tables,$database,$auto_include);
18671874
$fields = $this->findFields($tables,$columns,$exclude,$select,$database);
@@ -1873,22 +1880,15 @@ protected function getParameters($settings) {
18731880
if ($tenancy_function) $this->applyTenancyFunction($tenancy_function,$action,$database,$fields,$filters);
18741881
if ($column_authorizer) $this->applyColumnAuthorizer($column_authorizer,$action,$database,$fields);
18751882

1876-
// input
1877-
$multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false);
1878-
$contexts = $this->retrieveInputs($post);
1879-
if ($before) {
1880-
$this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$contexts);
1881-
}
1882-
$inputs = array();
1883-
foreach ($contexts as $context) {
1883+
foreach ($inputs as $k=>$context) {
18841884
$input = $this->filterInputByFields($context,$fields[$tables[0]]);
18851885

18861886
if ($tenancy_function) $this->applyInputTenancy($tenancy_function,$action,$database,$tables[0],$input,$fields[$tables[0]]);
18871887
if ($input_sanitizer) $this->applyInputSanitizer($input_sanitizer,$action,$database,$tables[0],$input,$fields[$tables[0]]);
18881888
if ($input_validator) $this->applyInputValidator($input_validator,$action,$database,$tables[0],$input,$fields[$tables[0]],$context);
18891889

18901890
$this->convertInputs($input,$fields[$tables[0]]);
1891-
$inputs[] = $input;
1891+
$inputs[$k] = $input;
18921892
}
18931893

18941894
return compact('action','database','tables','key','page','filters','fields','orderings','transform','multi','inputs','collect','select','before','after');

0 commit comments

Comments
 (0)