From 05af2b8b663badcccaef3c4f26a13842f94750d0 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 17 Oct 2026 17:41:12 +0200 Subject: retypage date prestations en string 1 --- src/model/entities/Prestation.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/model/entities/Prestation.php b/src/model/entities/Prestation.php index e7abd8b..9628afc 100644 --- a/src/model/entities/Prestation.php +++ b/src/model/entities/Prestation.php @@ -19,8 +19,16 @@ class Prestation #[ORM\Column] private string $code_presta; + #[ORM\Column] private int $date; // timestamp unix + + // ajouter attrinut ", nullable: true" + // remplissage: UPDATE prestations SET date_new = strftime('%Y-%m-%d', date, 'unixepoch'); + // ensuite remettre NOT NULL + #[ORM\Column(type: 'string', length: 10)] // format 'aaaa-mm-jj' + private string $date_new; + #[ORM\Column] private string $type_presta; #[ORM\Column] @@ -77,7 +85,7 @@ class Prestation public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this) { - $code_presta_tableau = explode('-', $this->code_presta); + //$code_presta_tableau = explode('-', $this->code_presta); $Date = new Dates($this->date); return [ -- cgit v1.2.3