diff options
Diffstat (limited to 'src/Model/Menu.php')
-rw-r--r-- | src/Model/Menu.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Model/Menu.php b/src/Model/Menu.php index e69de29..d0a281e 100644 --- a/src/Model/Menu.php +++ b/src/Model/Menu.php @@ -0,0 +1,38 @@ +<?php + +namespace App\Model; + +use App\Model\Model; + +/** + * Menu Model + */ +class Menu extends Model +{ + protected $name; + protected $allergies; + protected $advanceTime; + + + public function __construct($name, $allergies, $advanceTime) + { + $this->name = $name; + $this->allergies = $allergies; + $this->setTime($advanceTime); + } + + public function setTime($time) + { + $this->advanceTime = str_replace('h', '', $time); + } + + public function getAdvanceTime(): int + { + return $this->advanceTime; + } + + public function toString() + { + return $this->name . ';' . $this->allergies; + } +} |