cleanup construct
This commit is contained in:
parent
b91bd3177a
commit
c05cb8d130
1 changed files with 9 additions and 9 deletions
18
api.php
18
api.php
|
|
@ -1862,6 +1862,13 @@ class PHP_CRUD_API {
|
|||
$page = $this->processPageParameter($page);
|
||||
$orderings = $this->processOrderingsParameter($orderings);
|
||||
|
||||
// input
|
||||
$multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false);
|
||||
$inputs = $this->retrieveInputs($post);
|
||||
if ($before) {
|
||||
$this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$inputs);
|
||||
}
|
||||
|
||||
// reflection
|
||||
list($tables,$collect,$select) = $this->findRelations($tables,$database,$auto_include);
|
||||
$fields = $this->findFields($tables,$columns,$exclude,$select,$database);
|
||||
|
|
@ -1873,14 +1880,7 @@ class PHP_CRUD_API {
|
|||
if ($tenancy_function) $this->applyTenancyFunction($tenancy_function,$action,$database,$fields,$filters);
|
||||
if ($column_authorizer) $this->applyColumnAuthorizer($column_authorizer,$action,$database,$fields);
|
||||
|
||||
// input
|
||||
$multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false);
|
||||
$contexts = $this->retrieveInputs($post);
|
||||
if ($before) {
|
||||
$this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$contexts);
|
||||
}
|
||||
$inputs = array();
|
||||
foreach ($contexts as $context) {
|
||||
foreach ($inputs as $k=>$context) {
|
||||
$input = $this->filterInputByFields($context,$fields[$tables[0]]);
|
||||
|
||||
if ($tenancy_function) $this->applyInputTenancy($tenancy_function,$action,$database,$tables[0],$input,$fields[$tables[0]]);
|
||||
|
|
@ -1888,7 +1888,7 @@ class PHP_CRUD_API {
|
|||
if ($input_validator) $this->applyInputValidator($input_validator,$action,$database,$tables[0],$input,$fields[$tables[0]],$context);
|
||||
|
||||
$this->convertInputs($input,$fields[$tables[0]]);
|
||||
$inputs[] = $input;
|
||||
$inputs[$k] = $input;
|
||||
}
|
||||
|
||||
return compact('action','database','tables','key','page','filters','fields','orderings','transform','multi','inputs','collect','select','before','after');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue