blob: c7e51f9a4a539dfc33ef8e7d6f2f90f6d48cb102 (
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 extends ModelBase
{
private $slug;
public function __construct($slug)
{
if(! $this->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 $this->get('ROOMS.'.$this->getSlug().'.STREAM', $this->getSlug());
}
public function getDisplay() {
return $this->get('ROOMS.'.$this->getSlug().'.DISPLAY', $this->getSlug());
}
public function hasPreview() {
return get('ROOMS.'.$this->getSlug().'.PREVIEW');
}
public function hasSchedule() {
return $this->get('ROOMS.'.$this->getSlug().'.SCHEDULE') && $this->has('SCHEDULE');
}
}
|