| 1 | <?php |
||
| 13 | class UserRecord |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | * |
||
| 18 | * @Slumber\AsString() |
||
| 19 | */ |
||
| 20 | private $userId; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | * |
||
| 25 | * @Slumber\AsString() |
||
| 26 | */ |
||
| 27 | private $name; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | * |
||
| 32 | * @Slumber\AsString() |
||
| 33 | */ |
||
| 34 | private $role; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | * |
||
| 39 | * @Slumber\AsString() |
||
| 40 | */ |
||
| 41 | private $ip; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var string |
||
| 45 | * |
||
| 46 | * @Slumber\AsString() |
||
| 47 | */ |
||
| 48 | private $userAgent; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Use this to store a hashed version of the users session id. |
||
| 52 | * |
||
| 53 | * For security reason it is HIGHLY recommended to NOT store the real session id. |
||
| 54 | * |
||
| 55 | * @var string |
||
| 56 | * |
||
| 57 | * @Slumber\AsString() |
||
| 58 | */ |
||
| 59 | private $sessionHash; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function __toString() |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return string |
||
| 81 | */ |
||
| 82 | public function getUserId() |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @param string $userId |
||
| 89 | * |
||
| 90 | * @return $this |
||
| 91 | */ |
||
| 92 | 28 | public function setUserId($userId) |
|
| 98 | |||
| 99 | /** |
||
| 100 | * @return string |
||
| 101 | */ |
||
| 102 | 5 | public function getName() |
|
| 106 | |||
| 107 | /** |
||
| 108 | * @param string $name |
||
| 109 | * |
||
| 110 | * @return $this |
||
| 111 | */ |
||
| 112 | 28 | public function setName($name) |
|
| 118 | |||
| 119 | /** |
||
| 120 | * @return string |
||
| 121 | */ |
||
| 122 | 3 | public function getRole() |
|
| 126 | |||
| 127 | /** |
||
| 128 | * @param string $role |
||
| 129 | * |
||
| 130 | * @return $this |
||
| 131 | */ |
||
| 132 | 28 | public function setRole($role) |
|
| 138 | |||
| 139 | /** |
||
| 140 | * @return string |
||
| 141 | */ |
||
| 142 | 3 | public function getIp() |
|
| 146 | |||
| 147 | /** |
||
| 148 | * @param string $ip |
||
| 149 | * |
||
| 150 | * @return $this |
||
| 151 | */ |
||
| 152 | 28 | public function setIp($ip) |
|
| 158 | |||
| 159 | /** |
||
| 160 | * @return string |
||
| 161 | */ |
||
| 162 | public function getUserAgent() |
||
| 166 | |||
| 167 | /** |
||
| 168 | * @param string $userAgent |
||
| 169 | * |
||
| 170 | * @return $this |
||
| 171 | */ |
||
| 172 | 28 | public function setUserAgent($userAgent) |
|
| 178 | |||
| 179 | /** |
||
| 180 | * @return string |
||
| 181 | */ |
||
| 182 | public function getSessionHash() : string |
||
| 186 | |||
| 187 | /** |
||
| 188 | * @param string $sessionHash |
||
| 189 | * |
||
| 190 | * @return $this |
||
| 191 | */ |
||
| 192 | 28 | public function setSessionHash(string $sessionHash) |
|
| 198 | } |
||
| 199 |