diff options
author | emkael <emkael@tlen.pl> | 2016-03-10 13:43:14 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-03-10 13:43:14 +0100 |
commit | 4faae2d037efc21291c1031c9fd7b4c67bb25741 (patch) | |
tree | b16c156a8ac0a9f9a5d4c4b0611d578e513cda98 /app/php | |
parent | 153b7f441b006d5b5ae630fc5b17772ee4ff9781 (diff) |
* calendar preference retrieval
Diffstat (limited to 'app/php')
-rw-r--r-- | app/php/user/DbUser.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/php/user/DbUser.php b/app/php/user/DbUser.php index c8273f7..c8459fa 100644 --- a/app/php/user/DbUser.php +++ b/app/php/user/DbUser.php @@ -2,6 +2,7 @@ Prado::using('System.Security.TDbUserManager'); Prado::using('Application.model.User'); +Prado::using('Application.model.Calendar'); class DbUser extends TDbUser { @@ -53,6 +54,14 @@ class DbUser extends TDbUser { throw new Exception('Unimplemented CustomDbUser method'); } + public function getCalendarPreference() { + if ($this->IsGuest) { + return Calendar::finder()->findAllByIsVisible(1); + } else { + return $this->DbRecord->Calendars; + } + } + } ?> |