summaryrefslogtreecommitdiff
path: root/app/frontend/dto/UserKeyDTO.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-10-25 18:59:02 +0200
committeremkael <emkael@tlen.pl>2016-10-25 18:59:02 +0200
commit7f15fb107344f5e876df6f053004415ea1759c70 (patch)
tree687955f48eacfa27a2e7f1375f7a24b311187df9 /app/frontend/dto/UserKeyDTO.php
parent95e5a74b0663e9110ea638dd5d809e9fd1541fa9 (diff)
* saving and restoring user data from cookie
Diffstat (limited to 'app/frontend/dto/UserKeyDTO.php')
-rw-r--r--app/frontend/dto/UserKeyDTO.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/frontend/dto/UserKeyDTO.php b/app/frontend/dto/UserKeyDTO.php
new file mode 100644
index 0000000..1dbca8e
--- /dev/null
+++ b/app/frontend/dto/UserKeyDTO.php
@@ -0,0 +1,26 @@
+<?php
+
+Prado::using('Application.dto.BaseDTO');
+Prado::using('Application.model.UserAuthKey');
+
+class UserKeyDTO extends BaseDTO {
+
+ public $User;
+ public $Key;
+ public $IPAddress;
+
+ public function loadRecord(UserAuthKey $record) {
+ if ($record->User) {
+ $this->User = $record->User->Login;
+ }
+ $this->Key = $record->AuthKey;
+ $this->IPAddress = $record->IPAddress;
+ }
+
+ public static function __compare(UserKeyDTO $dto1, UserKeyDTO $dto2) {
+ return strcmp($dto1->Key, $dto2->Key);
+ }
+
+}
+
+?>