public static function get($who)
{
if ($who instanceof User) {
$user = $who;
} elseif (is_numeric($who)) {
// Got a User ID
$user = self::get_by_id($who);
} else {
// Got username or email
$user = self::get_by_name($who);
if (!$user && strpos($who, '@') !== false) {
// Got an email address
$user = self::get_by_email($who);
}
}
// $user will be a user object, or false depending on the
// results of the get_by_* method called above
return $user;
}