summaryrefslogtreecommitdiff
path: root/src/Model/Menu.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2018-05-07 15:24:00 +0100
committerFbenas <philbeansburton@gmail.com>2018-05-07 15:24:00 +0100
commit19564c9e18ae456e39bc2c8a306f9e79dd619e11 (patch)
treebcaa30f4cdc273bd55af7948ed252bda3b4b8412 /src/Model/Menu.php
parent8350b6bd36d3a4bb3a99dfbf67e746f4f815927c (diff)
Docblock and fix toString functions
Diffstat (limited to 'src/Model/Menu.php')
-rw-r--r--src/Model/Menu.php49
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;
}