dblayer : don't check the non provided field in update

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1623 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-07-31 12:54:04 +00:00
parent 33f15aff33
commit dea292339a

View File

@@ -457,9 +457,10 @@ class dblayer extends PDO
// Check for missing parameters
foreach ($this->fields as $key=>$params)
{
// Verify the fields, if $verify is defined, before doing insertion
if (array_key_exists ($key, $datas))
$datasOK[$key] = $datas[$key];
// Don't save a none provided field. The old value will be use in database
if (!array_key_exists ($key, $datas))
continue;
// Check for type inconsistencies if the value is provided
if ($datas[$key] !== "" && $params[0] === "integer")
{
@@ -504,6 +505,8 @@ class dblayer extends PDO
{
// Nothing to do if the value is empty : just save it
}
$datasOK[$key] = $datas[$key];
}
if (count ($datasOK) === 0)