GetQuotaEvent.php 959 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\IUser;
  10. /**
  11. * Event to allow apps to
  12. *
  13. * @since 20.0.0
  14. */
  15. class GetQuotaEvent extends Event {
  16. /** @var IUser */
  17. private $user;
  18. /** @var string|null */
  19. private $quota = null;
  20. /**
  21. * @since 20.0.0
  22. */
  23. public function __construct(IUser $user) {
  24. parent::__construct();
  25. $this->user = $user;
  26. }
  27. /**
  28. * @since 20.0.0
  29. */
  30. public function getUser(): IUser {
  31. return $this->user;
  32. }
  33. /**
  34. * Get the set quota as human readable string, or null if no overwrite is set
  35. *
  36. * @since 20.0.0
  37. */
  38. public function getQuota(): ?string {
  39. return $this->quota;
  40. }
  41. /**
  42. * Set the quota overwrite as human readable string
  43. *
  44. * @since 20.0.0
  45. */
  46. public function setQuota(string $quota): void {
  47. $this->quota = $quota;
  48. }
  49. }