From 4d638aa9fb3081742bd85c9396e9204f36a5e9f2 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 30 Mar 2015 21:37:32 +0200 Subject: Default Tab- and Selection access --- model/Room.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'model/Room.php') diff --git a/model/Room.php b/model/Room.php index f9d5efe..cac01cc 100644 --- a/model/Room.php +++ b/model/Room.php @@ -195,8 +195,14 @@ class Room extends ModelBase return $selections; } - public function createSelectionObject($selection) + public function createSelectionObject($selection = null) { + if(!$selection) + { + $selections = $this->getSelectionNames(); + $selection = $selections[0]; + } + return new RoomSelection($this, $selection); } @@ -209,8 +215,14 @@ class Room extends ModelBase return $tabs; } - public function createTabObject($tab) + public function createTabObject($tab = null) { + if(!$tab) + { + $tabs = $this->getTabNames(); + $tab = $tabs[0]; + } + return new RoomTab($this, $tab); } -- cgit v1.2.3