summaryrefslogtreecommitdiff
path: root/app/php/facades/EventFacade.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-06 17:12:20 +0200
committeremkael <emkael@tlen.pl>2016-05-06 17:12:20 +0200
commitcd2b68cdacf635807943eec8257103b4f4cef521 (patch)
tree4139c65471d2848222f303d3b61b49d87c005665 /app/php/facades/EventFacade.php
parent5f17c3263298fde6a32102410157f36b2335fe72 (diff)
* calendar fetch fallback for empty event list
Diffstat (limited to 'app/php/facades/EventFacade.php')
-rw-r--r--app/php/facades/EventFacade.php19
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 [];
}
}