diff options
author | emkael <emkael@tlen.pl> | 2016-04-14 13:29:24 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-04-14 13:29:24 +0200 |
commit | b4c75f6b8ddf12082431225ded19a30a5292770e (patch) | |
tree | 73513668c89e395205bd54e4480e362c7be1576a /app/php/controls | |
parent | 52a90cc018efebab9ab83332b93917bf934237ce (diff) |
* event facade refactoring in upcoming events control
Diffstat (limited to 'app/php/controls')
-rw-r--r-- | app/php/controls/UpcomingEvents.php | 10 |
1 files changed, 9 insertions, 1 deletions
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 ); |