summaryrefslogtreecommitdiff
path: root/app/php/facades/EventFacade.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/facades/EventFacade.php')
-rw-r--r--app/php/facades/EventFacade.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/php/facades/EventFacade.php b/app/php/facades/EventFacade.php
new file mode 100644
index 0000000..6ed739f
--- /dev/null
+++ b/app/php/facades/EventFacade.php
@@ -0,0 +1,35 @@
+<?php
+
+Prado::using('Application.facades.Facade');
+
+class EventFacade extends Facade {
+
+ public function getEventList($dateFrom=NULL, $dateTo=NULL, $calendars=NULL) {
+ $calendarClause = '1=1';
+ if ($calendars) {
+ $calendarClause = sprintf(
+ '_calendar IN (%s)',
+ implode(
+ ',',
+ array_map(
+ function($calendar) {
+ return $this->quoteString($calendar->UID);
+ },
+ $calendars
+ )
+ )
+ );
+ }
+ return $this->fetchList(
+ 'getEvents',
+ array(
+ 'date_from' => $dateFrom ?: '0000-00-00 00:00:00',
+ 'date_to' => $dateTo ?: '9999-99-99',
+ 'calendar_clause' => $calendarClause
+ )
+ );
+ }
+
+}
+
+?>