From 90be2156c1bc26ae788d1ecfefb681db28e3fad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr> Date: Tue, 29 Oct 2024 12:29:12 +0100 Subject: [PATCH] =?UTF-8?q?Gestion=20des=20ID=20=C3=A0=200=20pour=20les=20?= =?UTF-8?q?HISTO=20USERS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Table.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Table.php b/src/Table.php index f2f7464..5cbd54b 100644 --- a/src/Table.php +++ b/src/Table.php @@ -316,8 +316,8 @@ class Table $data[$idCol] = $this->lastInsertId; } - $histoUserId = (int)$bdd->getHistoUserId(); - if ($histoUserId && $this->hasHistorique()) { + $histoUserId = $bdd->getHistoUserId(); + if ($histoUserId !== null && $this->hasHistorique()) { $histoCreationCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_CREATION_COLUMN); $histoCreateurIdCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_CREATEUR_ID_COLUMN); $histoModificationCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_MODIFICATION_COLUMN); @@ -367,8 +367,8 @@ class Table $params = []; - $histoUserId = (int)$bdd->getHistoUserId(); - if ($histoUserId && $this->hasHistorique()) { + $histoUserId = $bdd->getHistoUserId(); + if ($histoUserId !== null && $this->hasHistorique()) { $histoModificationCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_MODIFICATION_COLUMN); $histoModificateurIdCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_MODIFICATEUR_ID_COLUMN); @@ -445,7 +445,7 @@ class Table $ddl = $this->getDdl(); $bdd = $this->getBdd(); - $histoUserId = (int)$bdd->getHistoUserId(); + $histoUserId = $bdd->getHistoUserId(); $hasHistorique = $this->hasHistorique(); $idCol = $this->getBdd()->getOption(Bdd::OPTION_ID_COLUMN); @@ -491,7 +491,7 @@ class Table $n = null; } - if (empty($n) && $options['soft-delete'] && $hasHistorique && $histoUserId) { // SOFT DELETE + if (empty($n) && $options['soft-delete'] && $hasHistorique && $histoUserId !== null) { // SOFT DELETE $histoDestructionCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_DESTRUCTION_COLUMN); $histoDestructeurIdCol = $this->getBdd()->getOption(Bdd::OPTION_HISTO_DESTRUCTEUR_ID_COLUMN); -- GitLab