In creation, non mandatory and inexisting fields are not asked
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1340 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -101,6 +101,8 @@ class dblayer extends PDO
|
|||||||
$datas[$key] = null;
|
$datas[$key] = null;
|
||||||
if (in_array ("not null", $params) && !array_key_exists ($key, $datas))
|
if (in_array ("not null", $params) && !array_key_exists ($key, $datas))
|
||||||
throw new Exception ("Mandatory field '$key' not provided", 405);
|
throw new Exception ("Mandatory field '$key' not provided", 405);
|
||||||
|
if (!array_key_exists ($key, $datas))
|
||||||
|
continue;
|
||||||
// Verify the fields, if $verify is defined, before doing insertion
|
// Verify the fields, if $verify is defined, before doing insertion
|
||||||
$verify = $this->verifyOne ($key, $datas[$key]);
|
$verify = $this->verifyOne ($key, $datas[$key]);
|
||||||
if (is_array ($verify) && count ($verify))
|
if (is_array ($verify) && count ($verify))
|
||||||
|
|||||||
Reference in New Issue
Block a user