*/ class Menu extends Model { /** * Name of this menu * * @var string */ protected $name; /** * Allergies string * * @var string */ protected $allergies; /** * Required advanced notice time in horus for this menu * * @var int */ protected $advanceTime; /** * Set the class attributes * * @author Phil Burton * @param $name * @param $allergies * @param $advanceTime */ public function __construct($name, $allergies, $advanceTime) { $this->name = $name; $this->allergies = $allergies; $this->setTime($advanceTime); } /** * Set the time removing the `h` if given * e.g. 12h becomes 12 * * @author Phil Burton * @param mixed $time */ public function setTime($time) { $this->advanceTime = str_replace('h', '', $time); } /** * Returbn the advancedd time * * @author Phil Burton * @return int */ public function getAdvanceTime(): int { return $this->advanceTime; } /** * Return a string representation of this menu * * @author Phil Burton * @return string */ public function toString(): string { return $this->name . ';' . $this->allergies; } }