SwitchUserEvent.php 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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\Component\Security\Http\Event;
  11. use Symfony\Component\EventDispatcher\Event;
  12. use Symfony\Component\HttpFoundation\Request;
  13. use Symfony\Component\Security\Core\User\UserInterface;
  14. /**
  15. * SwitchUserEvent.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. class SwitchUserEvent extends Event
  20. {
  21. private $request;
  22. private $targetUser;
  23. public function __construct(Request $request, UserInterface $targetUser)
  24. {
  25. $this->request = $request;
  26. $this->targetUser = $targetUser;
  27. }
  28. /**
  29. * @return Request
  30. */
  31. public function getRequest()
  32. {
  33. return $this->request;
  34. }
  35. /**
  36. * @return UserInterface
  37. */
  38. public function getTargetUser()
  39. {
  40. return $this->targetUser;
  41. }
  42. }