aboutsummaryrefslogtreecommitdiff
path: root/model/Room.php
blob: fc1b40deb71533fa904f925031b7c1226f736280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

class Room
{
	private $slug;

	public function __construct($slug)
	{
		if(! has('ROOMS.'.$slug))
			throw new NotFoundException('Room '.$slug);

		$this->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');
	}
}