1
0

UserCreatedEvent.php 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 when a new user has been created on the back-end.
  12. *
  13. * @since 18.0.0
  14. */
  15. class UserCreatedEvent extends Event {
  16. /** @var IUser */
  17. private $user;
  18. /** @var string */
  19. private $password;
  20. /**
  21. * @since 18.0.0
  22. */
  23. public function __construct(IUser $user,
  24. string $password) {
  25. parent::__construct();
  26. $this->user = $user;
  27. $this->password = $password;
  28. }
  29. /**
  30. * @since 18.0.0
  31. */
  32. public function getUser(): IUser {
  33. return $this->user;
  34. }
  35. /**
  36. * @since 18.0.0
  37. */
  38. public function getUid(): string {
  39. return $this->user->getUID();
  40. }
  41. /**
  42. * @since 18.0.0
  43. */
  44. public function getPassword(): string {
  45. return $this->password;
  46. }
  47. }