[Fixed] Creation de machine (orm, insert NULL values)

This commit is contained in:
xdrm-brackets 2017-02-20 09:57:26 +01:00
parent ad13cf0f6e
commit 0771694be8
2 changed files with 5 additions and 2 deletions

View File

@ -27,8 +27,8 @@
'id_machine' => Rows::INSERT_DEFAULT,
'id_warehouse' => $id_warehouse,
'name' => $name,
'token' => Rows::NULL,
'unlock_code' => Rows::NULL
'token' => null,
'unlock_code' => null
]);
// Si erreur (car name doit être unique)

View File

@ -664,6 +664,8 @@
foreach($set as $field=>$value){
if( is_null($value) ) continue;
$type = $this->schema['columns'][$field]['type'];
// {1} Si de type INT/FLOAT et pas numérique, on retire le champ //
@ -713,6 +715,7 @@
// Si l'entrée est donnée
if( isset($set[$field]) )
if( $set[$field] == self::INSERT_DEFAULT ) $requestS .= 'DEFAULT'; // On insère directement les valeurs 'DEFAULT'
else if( is_null($set[$field]) ) $requestS .= 'NULL';
else $requestS .= ':insert_'.$field.'_'.$i;
else
$requestS .= 'DEFAULT';