🔧 Utilise l'id plutôt que le nom
Comme ça, s'il change, on est safe
This commit is contained in:
11
app/Deal.php
11
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']];
|
||||
|
Reference in New Issue
Block a user