summaryrefslogtreecommitdiff
path: root/app/php/controls
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-14 13:29:24 +0200
committeremkael <emkael@tlen.pl>2016-04-14 13:29:24 +0200
commitb4c75f6b8ddf12082431225ded19a30a5292770e (patch)
tree73513668c89e395205bd54e4480e362c7be1576a /app/php/controls
parent52a90cc018efebab9ab83332b93917bf934237ce (diff)
* event facade refactoring in upcoming events control
Diffstat (limited to 'app/php/controls')
-rw-r--r--app/php/controls/UpcomingEvents.php10
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
);