From b4c75f6b8ddf12082431225ded19a30a5292770e Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 14 Apr 2016 13:29:24 +0200 Subject: * event facade refactoring in upcoming events control --- app/php/controls/UpcomingEvents.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/php/controls/UpcomingEvents.php') diff --git a/app/php/controls/UpcomingEvents.php b/app/php/controls/UpcomingEvents.php index 27fa8c6..3b0869a 100644 --- a/app/php/controls/UpcomingEvents.php +++ b/app/php/controls/UpcomingEvents.php @@ -4,6 +4,14 @@ Prado::using('Application.facades.EventFacade'); class UpcomingEvents extends TTemplateControl { + public function setFacade(Facade $facade) { + $this->setViewState('Facade', $facade); + } + + public function getFacade() { + return $this->getViewState('Facade'); + } + public function getUserToDisplay() { return $this->getControlState('user'); } @@ -24,7 +32,7 @@ class UpcomingEvents extends TTemplateControl { $utc = new DateTimeZone('UTC'); $dateFrom = new DateTime('now', $utc); $dateTo = new DateTime('+7 days', $utc); - return EventFacade::getInstance()->getTimeframeListForUser( + return $this->getFacade()->getTimeframeListForUser( $user, $dateFrom, $dateTo ); -- cgit v1.2.3