From dedbe2f5cee33431c1299c7f0dbef4e247dc2447 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 19 Dec 2022 02:51:03 +0100 Subject: nouveau client main.php en cours --- src/model/traits.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/model/traits.php (limited to 'src/model/traits.php') diff --git a/src/model/traits.php b/src/model/traits.php new file mode 100644 index 0000000..43d9b7f --- /dev/null +++ b/src/model/traits.php @@ -0,0 +1,16 @@ +table = strtolower(__CLASS__); + } + + public function setIdFromLastInsertID() // à faire juste après l'écriture d'une nouvelle entrée + { + $this->db = parent::getInstance(); + $this->ID = $this->db->lastInsertId(); // méthode de PDO + } +} -- cgit v1.2.3