From be5336fc139a319520cb2f025e163ccf6cc26fd3 Mon Sep 17 00:00:00 2001 From: Clement Desmidt Date: Tue, 21 Nov 2017 07:20:14 +0100 Subject: [PATCH] =?UTF-8?q?:wrench:=20Utilise=20l'id=20plut=C3=B4t=20que?= =?UTF-8?q?=20le=20nom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comme ça, s'il change, on est safe --- app/Deal.php | 11 +++++++++++ resources/views/update.blade.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Deal.php b/app/Deal.php index fb1f0ab..5678533 100644 --- a/app/Deal.php +++ b/app/Deal.php @@ -91,6 +91,17 @@ class Deal return $this->data['price']; } + /** + * @return int + */ + public function getIdCategory(): int + { + return (int) $this->data['category']; + } + + /** + * @return string + */ public function getCategory(): string { return Categories::$categories[$this->data['category']]; diff --git a/resources/views/update.blade.php b/resources/views/update.blade.php index 944d56f..92eb6cc 100644 --- a/resources/views/update.blade.php +++ b/resources/views/update.blade.php @@ -25,7 +25,7 @@