From a012ea9e7d5dd0baadb549e1460a8339224f37a5 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 14 May 2015 11:18:12 +0200 Subject: Own Model class; new namespaces Database and Controllers; RFC2822 dates --- src/CamilStaps/BotleaguesApi/Database/User.php | 75 ++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/CamilStaps/BotleaguesApi/Database/User.php (limited to 'src/CamilStaps/BotleaguesApi/Database/User.php') diff --git a/src/CamilStaps/BotleaguesApi/Database/User.php b/src/CamilStaps/BotleaguesApi/Database/User.php new file mode 100644 index 0000000..383cc38 --- /dev/null +++ b/src/CamilStaps/BotleaguesApi/Database/User.php @@ -0,0 +1,75 @@ +isAdministrator; + } + + public function validToken($token) { + return UserToken::where('userId', $this->id)->where('token', $token)->where('valid_till', '>', date("Y-m-d H:i:s"))->count() > 0; + } + + /** + * Get the unique identifier for the user. + * + * @return mixed + */ + public function getAuthIdentifier() { + return $this->getKey(); + } + + /** + * Get the password for the user. + * @todo not implemented yet + * @return string + */ + public function getAuthPassword() { + return $this->password; + } + + /** + * Get the token value for the "remember me" session. + * @todo not implemented yet + * @return string + */ + public function getRememberToken() { + return null; + } + + /** + * Set the token value for the "remember me" session. + * @todo not implemented yet + * @param string $value + * @return void + */ + public function setRememberToken($value) { + return null; + } + + /** + * Get the column name for the "remember me" token. + * @todo not implemented yet + * @return string + */ + public function getRememberTokenName() { + return null; + } + + /** + * Get the e-mail address where password reminders are sent. + * + * @return string + */ + public function getReminderEmail() { + return $this->email; + } +} \ No newline at end of file -- cgit v1.2.3