summaryrefslogtreecommitdiff
path: root/src/model/Clients.php
diff options
context:
space:
mode:
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}