table = strtolower(__CLASS__); // cesu } public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this) { return [ "Tâche effectuée:" => $this->taches, "Durée du travail:" => $this->duree_travail, "Salaire:" => $this->salaire]; } public function set(string $entry, string $input) { $input = $this->cleanSpecialChars($input); // possibilité que $input devienne une chaine vide switch($entry) { case "Tâche effectuée:": $this->setTaches($input); break; case "Durée du travail:": $this->setDureeTravail($input); break; case "Salaire:": $this->setSalaire($input); break; } } // setters public function setIdPresta(int $value) { $this->id_presta = $value; return($this); } public function setTaches(string $value) { $this->taches = $value; return($this); } public function setDureeTravail(string $value) { $this->duree_travail = $value; return($this); } public function setSalaire($value) { $value = str_replace(',', '.', $value); $this->salaire = (float) $value; return($this); } }