1
0

BeforeUserLoggedOutEvent.php 616 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User\Events;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\IUser;
  10. /**
  11. * Emitted before a user is logged out.
  12. *
  13. * @since 18.0.0
  14. */
  15. class BeforeUserLoggedOutEvent extends Event {
  16. /** @var IUser|null */
  17. private $user;
  18. /**
  19. * @since 18.0.0
  20. */
  21. public function __construct(?IUser $user = null) {
  22. parent::__construct();
  23. $this->user = $user;
  24. }
  25. /**
  26. * @since 18.0.0
  27. */
  28. public function getUser(): ?IUser {
  29. return $this->user;
  30. }
  31. }