Last active
November 1, 2016 12:44
-
-
Save alanwillms/8c27c15b6c6c1859dac9d08c85e94e3f to your computer and use it in GitHub Desktop.
ISP-5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Usuario extends ActiveRecord implements Identificavel | |
{ | |
public static function encontrarIdentidade($id) | |
{ | |
return static::findOne($id); | |
} | |
public static function encontrarIdentidadePeloToken($token, $tipo = null) | |
{ | |
return static::findOne(['token' => $token]); | |
} | |
public function getId() | |
{ | |
return $this->id; | |
} | |
public function getChaveAutenticacao() | |
{ | |
return $this->chaveAutenticacao; | |
} | |
public function validarChaveAutenticacao($chaveAutenticacao) | |
{ | |
return $this->chaveAutenticacao === $chaveAutenticacao; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment