aboutsummaryrefslogtreecommitdiff
path: root/model/RoomTab.php
diff options
context:
space:
mode:
authorMaZderMind2015-03-30 16:20:30 +0200
committerMaZderMind2015-03-30 16:20:30 +0200
commitf7d9d592745d1cb5cb2de76ed6ae99be974f1807 (patch)
tree0f9f77efe9efc70b3ac0404a46b249f809197922 /model/RoomTab.php
parentea4b6c7699a7fbb7be3d9e5ce86c84a36b63f569 (diff)
Implement MVT Pattern based on simple Config options
Diffstat (limited to '')
-rw-r--r--model/RoomTab.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/model/RoomTab.php b/model/RoomTab.php
new file mode 100644
index 0000000..d4f781b
--- /dev/null
+++ b/model/RoomTab.php
@@ -0,0 +1,34 @@
+<?php
+
+class RoomTab
+{
+ public function __construct(Room $room, $tab)
+ {
+ $this->room = $room;
+ $this->tab = $tab;
+ }
+
+ public function getRoom()
+ {
+ return $this->room;
+ }
+
+ public function getTab()
+ {
+ return $this->tab;
+ }
+
+ public function getLink()
+ {
+ $tabs = $this->getRoom()->getTabNames();
+ if($tabs[0] == $this->getTab())
+ return rawurlencode($this->getRoom()->getSlug()).'/';
+
+ return rawurlencode($this->getRoom()->getSlug()).'/'.rawurlencode($this->getTab()).'/';
+ }
+
+ public function getDisplay()
+ {
+ return ucfirst($this->getTab());
+ }
+}