From 546302cde914a2143f86e6a384cbc5085d55396a Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 2 Jun 2024 23:19:01 +0200 Subject: =?UTF-8?q?m=C3=A9thode=20cleanSpecialChars()=20pour=20g=C3=A9rer?= =?UTF-8?q?=20les=20",=20un=20peu=20sale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/Clients.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/model/Clients.php') diff --git a/src/model/Clients.php b/src/model/Clients.php index 0f70eb6..ce38d86 100644 --- a/src/model/Clients.php +++ b/src/model/Clients.php @@ -44,6 +44,7 @@ class Clients extends Model } public function set(string $entry, string $input) { + $input = $this->cleanSpecialChars($input); // possibilité que $input devienne une chaine vide switch($entry) { case "Prénom Nom:": @@ -104,8 +105,9 @@ class Clients extends Model } public function setTelephone($value) { - // type string parce que - // zenity renvoie une chaine, on peut ainsi garder le 0 au début et avoir plusieurs numéros (séparés par virgule et espace) + // type string parce que: + // - zenity renvoie une chaine + // - permet de garder le 0 au début et d'inscrire plusieurs numéros $this->telephone = (string) $value; return $this; } @@ -124,6 +126,7 @@ class Clients extends Model $this->type = (string) $value; return $this; } + public function typeToClient(): bool { if($this->type != 'client') @@ -137,7 +140,6 @@ class Clients extends Model } } - public function findByKeywords(array $keywords, string $field): array // n'hydrate pas les variables, on doit choisir un client et hydrater ensuite { $result = []; -- cgit v1.2.3