From cb48ba9b7068302414b18435505a041d22bd9e4b Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 8 Mar 2015 13:42:58 +0100 Subject: Introduce Models abstracting the Config away from Views & Templates --- model/Room.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 model/Room.php (limited to 'model/Room.php') diff --git a/model/Room.php b/model/Room.php new file mode 100644 index 0000000..7394870 --- /dev/null +++ b/model/Room.php @@ -0,0 +1,49 @@ +slug = $slug; + } + + + public function getSlug() { + return $this->slug; + } + + public function getThumb() { + return 'thumbs/'.$this->getStream().'.png'; + } + + public function getLink() { + return rawurlencode($this->getSlug()).'/'; + } + + public function getStream() { + return get('ROOMS.'.$this->getSlug().'.STREAM', $this->getSlug()); + } + + public function getDisplay() { + return get('ROOMS.'.$this->getSlug().'.DISPLAY', $this->getSlug()); + } + + + + public function hasPreview() { + return get('ROOMS.'.$this->getSlug().'.PREVIEW'); + } + + public function hasSchedule() { + return get('ROOMS.'.$this->getSlug().'.SCHEDULE') && has('SCHEDULE'); + } +} -- cgit v1.2.3