Skip to content

Instantly share code, notes, and snippets.

@smottt
Created June 22, 2012 08:30
Show Gist options
  • Save smottt/2971330 to your computer and use it in GitHub Desktop.
Save smottt/2971330 to your computer and use it in GitHub Desktop.
UserInterface equals method
<?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