summaryrefslogtreecommitdiff
path: root/src/model/Clients.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2022-12-19 02:51:03 +0100
committerpolo <ordipolo@gmx.fr>2022-12-19 02:51:03 +0100
commitdedbe2f5cee33431c1299c7f0dbef4e247dc2447 (patch)
tree4d2481ca044aae30886a9879acd53c4777c180bc /src/model/Clients.php
parentff14091476a35de16a9ea3208501040cfae93a06 (diff)
downloadAppliGestionPHP-dedbe2f5cee33431c1299c7f0dbef4e247dc2447.zip
nouveau client main.php en cours
Diffstat (limited to 'src/model/Clients.php')
-rw-r--r--src/model/Clients.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/model/Clients.php b/src/model/Clients.php
index 1256458..816cff3 100644
--- a/src/model/Clients.php
+++ b/src/model/Clients.php
@@ -10,10 +10,7 @@ class Clients extends Model
10 public $code_client; 10 public $code_client;
11 public $commentaires; 11 public $commentaires;
12 12
13 public function __construct() 13 use ModelChildren; // renseigne parent::table
14 {
15 $this->table = strtolower(__CLASS__); // simple parce que la classe a le nom de la table
16 }
17 14
18 //~ public function set(string $variable, $value) 15 //~ public function set(string $variable, $value)
19 //~ { 16 //~ {
@@ -47,4 +44,12 @@ class Clients extends Model
47 $this->commentaires = $value; 44 $this->commentaires = $value;
48 return($this); 45 return($this);
49 } 46 }
47
48
49 public function newRow(array $entry)
50 {
51 $this->hydrate(['prenom_nom' => $entry[0], 'adresse' => $entry[1], 'code_client' => $entry[2], 'commentaires' => $entry[3]]);
52 $this->create();
53 $this->setIdFromLastInsertID();
54 }
50} 55}