Created
June 22, 2012 08:30
-
-
Save smottt/2971330 to your computer and use it in GitHub Desktop.
UserInterface equals method
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 | |
class User implements UserInterface | |
{ | |
// ... | |
/** | |
* Compares this user to another to determine if they are the same. | |
* | |
* @param UserInterface $user | |
* @return boolean True if equal, false otherwise. | |
*/ | |
public function equals(UserInterface $user) | |
{ | |
return md5($user->getUsername()) == md5($this->getUsername()); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment