From 823d71ced9b4947b1a5a5ade7245d521ed490061 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Jun 2016 15:17:49 +0200 Subject: * renaming php directory --- app/frontend/controls/UpcomingEvents.php | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 app/frontend/controls/UpcomingEvents.php (limited to 'app/frontend/controls/UpcomingEvents.php') diff --git a/app/frontend/controls/UpcomingEvents.php b/app/frontend/controls/UpcomingEvents.php new file mode 100644 index 0000000..27fc723 --- /dev/null +++ b/app/frontend/controls/UpcomingEvents.php @@ -0,0 +1,33 @@ +getControlState('user'); + } + + public function setUserToDisplay(DbUser $user) { + $this->setControlState('user', $user); + } + + public function getEvents() { + return $this->_getEventsForUser($this->UserToDisplay); + } + + private function _getEventsForUser(DbUser $user) { + $utc = new DateTimeZone('UTC'); + $dateFrom = new DateTime('now', $utc); + $dateTo = new DateTime('+7 days', $utc); + return $this->getFacade()->getTimeframeListForUser( + $user, + $dateFrom, $dateTo + ); + } + +} + +?> -- cgit v1.2.3