summaryrefslogtreecommitdiff
path: root/app/php/facades/UserFacade.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-06 15:52:26 +0200
committeremkael <emkael@tlen.pl>2016-05-06 15:52:41 +0200
commit306af7af3aaa315701f41924d786c09832fbb15a (patch)
tree9931695697f8647624b239c1a92ceb70fa873fdd /app/php/facades/UserFacade.php
parentb335c69d6e7439fe9b91f4af138e386934631433 (diff)
* moving code blocks around
Diffstat (limited to 'app/php/facades/UserFacade.php')
-rw-r--r--app/php/facades/UserFacade.php36
1 files changed, 17 insertions, 19 deletions
diff --git a/app/php/facades/UserFacade.php b/app/php/facades/UserFacade.php
index 1fddb28..3e32a8d 100644
--- a/app/php/facades/UserFacade.php
+++ b/app/php/facades/UserFacade.php
@@ -7,25 +7,6 @@ Prado::using('Application.dto.TimezoneDTO');
class UserFacade extends Facade {
- public function setTimezonePreference(DbUser $user, $timezone) {
- if ($user->IsGuest) {
- throw new TInvalidDataException(
- 'Timezone preference change impossible for guest user'
- );
- }
- $user->DbRecord->Timezone = $timezone;
- $user->DbRecord->save();
- }
-
- public function getTimezonePreference(DbUser $user) {
- if (!$user->IsGuest) {
- try {
- return new TimezoneDTO($user->DbRecord->Timezone);
- } catch(Exception $e) {}
- }
- return new TimezoneDTO(date_default_timezone_get());
- }
-
public function findByLogin($login) {
return User::finder()->findByLogin($login);
}
@@ -63,7 +44,24 @@ class UserFacade extends Facade {
return password_verify($password, $dbPassword);
}
+ public function setTimezonePreference(DbUser $user, $timezone) {
+ if ($user->IsGuest) {
+ throw new TInvalidDataException(
+ 'Timezone preference change impossible for guest user'
+ );
+ }
+ $user->DbRecord->Timezone = $timezone;
+ $user->DbRecord->save();
+ }
+ public function getTimezonePreference(DbUser $user) {
+ if (!$user->IsGuest) {
+ try {
+ return new TimezoneDTO($user->DbRecord->Timezone);
+ } catch(Exception $e) {}
+ }
+ return new TimezoneDTO(date_default_timezone_get());
+ }
}