From c46cc80be58b318b886eb1f0ba7a30194f1447c6 Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Wed, 9 Sep 2015 03:40:40 +0200 Subject: make STARTS_AT and/or ENDS_AT optional This is especially useful for conferences which don't have a set time frame. --- model/Conference.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/Conference.php b/model/Conference.php index 28c96e1..fb29791 100644 --- a/model/Conference.php +++ b/model/Conference.php @@ -27,7 +27,11 @@ class Conference extends ModelBase return true; } - return time() >= $this->get('CONFERENCE.STARTS_AT'); + if($this->has('CONFERENCE.STARTS_AT')) { + return time() >= $this->get('CONFERENCE.STARTS_AT'); + } else { + return true; + } } public function hasEnded() { @@ -41,7 +45,11 @@ class Conference extends ModelBase return false; } - return time() >= $this->get('CONFERENCE.ENDS_AT'); + if($this->has('CONFERENCE.ENDS_AT')) { + return time() >= $this->get('CONFERENCE.ENDS_AT'); + } else { + return false; + } } public function hasAuthor() { -- cgit v1.2.3