From f7d9d592745d1cb5cb2de76ed6ae99be974f1807 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 30 Mar 2015 16:20:30 +0200 Subject: Implement MVT Pattern based on simple Config options --- model/RoomSelection.php | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 model/RoomSelection.php (limited to 'model/RoomSelection.php') diff --git a/model/RoomSelection.php b/model/RoomSelection.php new file mode 100644 index 0000000..c163321 --- /dev/null +++ b/model/RoomSelection.php @@ -0,0 +1,52 @@ +room = $room; + $this->selection = $selection; + } + + public function getRoom() + { + return $this->room; + } + + public function getSelection() + { + return $this->selection; + } + + public function getLink() + { + $selection = $this->getRoom()->getSelectionNames(); + if($selection[0] == $this->getSelection()) + return rawurlencode($this->getRoom()->getSlug()).'/'; + + return rawurlencode($this->getRoom()->getSlug()).'/'.rawurlencode($this->getSelection()).'/'; + } + + public function getTranslatedLink() + { + return $this->getLink().'translated/'; + } + + public function getDisplay() + { + switch($this->getSelection()) + { + case 'sd': + case 'hd': + return strtoupper($this->getSelection()); + + default: + return ucfirst($this->getSelection()); + } + } + + public function getTech() + { + return $this->getSelection().'-tech'; + } +} -- cgit v1.2.3