From 63c72a0bff307162859d09daf9380ca43cdb3b4c Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 6 May 2016 12:44:53 +0200 Subject: * calendar facade method for accessing events --- app/php/facades/CalendarFacade.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'app/php') diff --git a/app/php/facades/CalendarFacade.php b/app/php/facades/CalendarFacade.php index 71ddcb4..25dec5f 100644 --- a/app/php/facades/CalendarFacade.php +++ b/app/php/facades/CalendarFacade.php @@ -1,6 +1,7 @@ findAllByUID($calendar->ID); + if ($calendar) { + $events = EventFacade::getInstance()->getEventList( + $dateFrom->format('Y-m-d H:i:s'), + $dateTo->format('Y-m-d H:i:s'), + $calendar, + $order + ); + return array_map( + function($event) use($calendar) { + $dto = new EventDTO(); + $dto->loadRecord($event, $calendar); + return $dto; + }, + $events + ); + } + return []; + } + public function getAll() { return Calendar::finder()->withCategory()->findAll('ORDER BY name ASC'); } -- cgit v1.2.3