[Fixed] Creation de machine (orm, insert NULL values)
This commit is contained in:
parent
4bacb52f24
commit
e1a524faee
|
@ -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)
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue