Skip to content

Instantly share code, notes, and snippets.

@alanwillms
Last active November 1, 2016 12:44
Show Gist options
  • Save alanwillms/8c27c15b6c6c1859dac9d08c85e94e3f to your computer and use it in GitHub Desktop.
Save alanwillms/8c27c15b6c6c1859dac9d08c85e94e3f to your computer and use it in GitHub Desktop.
ISP-5
<?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