Created
May 19, 2012 06:06
-
-
Save coreymcmahon/2729536 to your computer and use it in GitHub Desktop.
The UserInterface interface - http://www.symfonycentral.com/securing-your-web-application-with-symfony.html
This file contains hidden or 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 | |
interface UserInterface | |
{ | |
/** | |
* Returns an array of strings, where each string is a role that this user has. | |
* | |
* @return Role[] An array containing the roles this user has | |
*/ | |
function getRoles(); | |
/** | |
* Return the salted and hashed password for this user. | |
* | |
* @return string The password | |
*/ | |
function getPassword(); | |
/** | |
* Return the "salt" value used to save this user's password. | |
* | |
* @return bool|string The salt | |
*/ | |
function getSalt(); | |
/** | |
* Return the username of this user. | |
* | |
* @return string The username | |
*/ | |
function getUsername(); | |
/** | |
* Remove sensitive information from the user object. | |
* | |
* @return void | |
*/ | |
function eraseCredentials(); | |
/** | |
* Given another User object, return true if the provided $user is equivalent to this one. | |
* | |
* @param UserInterface $user | |
* @return Boolean | |
*/ | |
function equals(UserInterface $user); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment