diff options
Diffstat (limited to 'src/Model/Menu.php')
-rw-r--r-- | src/Model/Menu.php | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/src/Model/Menu.php b/src/Model/Menu.php index d0a281e..3fea03f 100644 --- a/src/Model/Menu.php +++ b/src/Model/Menu.php @@ -6,14 +6,40 @@ use App\Model\Model; /** * Menu Model + * + * @author Phil Burton <phil@pgburton.com> */ class Menu extends Model { + /** + * Name of this menu + * + * @var string + */ protected $name; + + /** + * Allergies string + * + * @var string + */ protected $allergies; - protected $advanceTime; + /** + * Required advanced notice time in horus for this menu + * + * @var int + */ + protected $advanceTime; + /** + * Set the class attributes + * + * @author Phil Burton <phil@pgburton.com> + * @param $name + * @param $allergies + * @param $advanceTime + */ public function __construct($name, $allergies, $advanceTime) { $this->name = $name; @@ -21,17 +47,36 @@ class Menu extends Model $this->setTime($advanceTime); } + /** + * Set the time removing the `h` if given + * e.g. 12h becomes 12 + * + * @author Phil Burton <phil@pgburton.com> + * @param mixed $time + */ public function setTime($time) { $this->advanceTime = str_replace('h', '', $time); } + /** + * Returbn the advancedd time + * + * @author Phil Burton <phil@pgburton.com> + * @return int + */ public function getAdvanceTime(): int { return $this->advanceTime; } - public function toString() + /** + * Return a string representation of this menu + * + * @author Phil Burton <phil@pgburton.com> + * @return string + */ + public function toString(): string { return $this->name . ';' . $this->allergies; } |