diff options
author | MaZderMind | 2015-03-30 21:37:08 +0200 |
---|---|---|
committer | MaZderMind | 2015-03-30 21:37:08 +0200 |
commit | 340e5ff295cc9ee06671e07548ac104092b5f978 (patch) | |
tree | 09d7e68bc1f9d407dd170eff9b77579e4fb0cb9d | |
parent | e6fbb1972fba163170940ab454d749c0ea35b587 (diff) |
Static existence checks for Rooms
Diffstat (limited to '')
-rw-r--r-- | model/Room.php | 13 |
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; |