UserLoaderInterface.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\Doctrine\Security\User;
  11. use Symfony\Component\Security\Core\User\UserInterface;
  12. /**
  13. * Represents a class that loads UserInterface objects from Doctrine source for the authentication system.
  14. *
  15. * This interface is meant to facilitate the loading of a User from Doctrine source using a custom method.
  16. * If you want to implement your own logic of retrieving the user from Doctrine your repository should implement this
  17. * interface.
  18. *
  19. * @see UserInterface
  20. *
  21. * @author Michal Trojanowski <michal@kmt-studio.pl>
  22. */
  23. interface UserLoaderInterface
  24. {
  25. /**
  26. * Loads the user for the given username.
  27. *
  28. * This method must return null if the user is not found.
  29. *
  30. * @return UserInterface|null
  31. */
  32. public function loadUserByUsername(string $username);
  33. }