aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--model/Room.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/model/Room.php b/model/Room.php
index 156576c..f9d5efe 100644
--- a/model/Room.php
+++ b/model/Room.php
@@ -12,6 +12,19 @@ class Room extends ModelBase
$this->slug = $slug;
}
+ public static function exists($slug)
+ {
+ return ModelBase::staticHas('ROOMS.'.$slug);
+ }
+
+ public static function createIfExists($room)
+ {
+ if(Room::exists($room))
+ return new Room($room);
+
+ return null;
+ }
+
public function getSlug() {
return $this->slug;