Example #1
0
 /**
  * Loads a user by username or email
  *
  * It is strongly discouraged to call this method manually as it bypasses
  * all ACL checks.
  *
  * @param string $username
  * @return UserInterface
  */
 public function loadUserByUsername($username)
 {
     // Allow a user to login with username or e-mail address
     $user = $this->findUserByUsernameOrEmail($username);
     if (!$user) {
         return parent::loadUserByUsername($username);
     }
     return $user;
 }