diff options
author | MaZderMind | 2016-12-10 18:22:34 +0100 |
---|---|---|
committer | MaZderMind | 2016-12-10 18:22:34 +0100 |
commit | f6c0270d40f6730fe1e1820f2866b08792df1db6 (patch) | |
tree | f0da1effc9f55f2f75dc57fe1ba17419d559b45b /model/Subtitles.php | |
parent | b227ac0ee80f6de300fed10a34e7393847227cfc (diff) |
rewrite data-model so that every configuration option is accessed through the conference
Diffstat (limited to 'model/Subtitles.php')
-rw-r--r-- | model/Subtitles.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/model/Subtitles.php b/model/Subtitles.php index e1878f2..1d401b8 100644 --- a/model/Subtitles.php +++ b/model/Subtitles.php @@ -1,14 +1,25 @@ <?php -class Subtitles extends ModelBase +class Subtitles { + private $conference; + + public function __construct(Conference $conference) + { + $this->conference = $conference; + } + + public function getConference() { + return $this->conference; + } + public function isEnabled() { - return $this->has('SUBTITLES'); + return $this->getConference()->has('SUBTITLES'); } public function getEnabledRooms($slug) { $rooms = []; - foreach(Room::rooms() as $room) + foreach($this->getConference()->getOverview()->getRooms() as $room) { if($room->hasSubtitles()) $rooms[] = $room; @@ -18,9 +29,9 @@ class Subtitles extends ModelBase } public function getPrimusURL() { - return $this->get('SUBTITLES.PRIMUS_URL'); + return $this->getConference()->get('SUBTITLES.PRIMUS_URL'); } public function getFrontendURL() { - return $this->get('SUBTITLES.FRONTEND_URL'); + return $this->getConference()->get('SUBTITLES.FRONTEND_URL'); } } |