diff options
author | emkael <emkael@tlen.pl> | 2016-05-06 17:12:20 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-06 17:12:20 +0200 |
commit | cd2b68cdacf635807943eec8257103b4f4cef521 (patch) | |
tree | 4139c65471d2848222f303d3b61b49d87c005665 /app/php/facades/EventFacade.php | |
parent | 5f17c3263298fde6a32102410157f36b2335fe72 (diff) |
* calendar fetch fallback for empty event list
Diffstat (limited to 'app/php/facades/EventFacade.php')
-rw-r--r-- | app/php/facades/EventFacade.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/app/php/facades/EventFacade.php b/app/php/facades/EventFacade.php index 9533448..08133bc 100644 --- a/app/php/facades/EventFacade.php +++ b/app/php/facades/EventFacade.php @@ -59,14 +59,17 @@ class EventFacade extends Facade { } private function _getCalendarsForEvents(array $events) { - return Calendar::finder()->findAllByPks( - array_map( - function($event) { - return $event->CalendarID; - }, - $events - ) - ); + if ($events) { + return Calendar::finder()->findAllByPks( + array_map( + function($event) { + return $event->CalendarID; + }, + $events + ) + ); + } + return []; } } |