AbstractCacheEvent.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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\Files\Cache;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\Files\Storage\IStorage;
  10. /**
  11. * @since 22.0.0
  12. */
  13. class AbstractCacheEvent extends Event implements ICacheEvent {
  14. protected $storage;
  15. protected $path;
  16. protected $fileId;
  17. protected $storageId;
  18. /**
  19. * @param IStorage $storage
  20. * @param string $path
  21. * @param int $fileId
  22. * @since 22.0.0
  23. */
  24. public function __construct(IStorage $storage, string $path, int $fileId, int $storageId) {
  25. $this->storage = $storage;
  26. $this->path = $path;
  27. $this->fileId = $fileId;
  28. $this->storageId = $storageId;
  29. }
  30. /**
  31. * @return IStorage
  32. * @since 22.0.0
  33. */
  34. public function getStorage(): IStorage {
  35. return $this->storage;
  36. }
  37. /**
  38. * @return string
  39. * @since 22.0.0
  40. */
  41. public function getPath(): string {
  42. return $this->path;
  43. }
  44. /**
  45. * @param string $path
  46. * @since 22.0.0
  47. */
  48. public function setPath(string $path): void {
  49. $this->path = $path;
  50. }
  51. /**
  52. * @return int
  53. * @since 22.0.0
  54. */
  55. public function getFileId(): int {
  56. return $this->fileId;
  57. }
  58. /**
  59. * @return int
  60. * @since 22.0.0
  61. */
  62. public function getStorageId(): int {
  63. return $this->storageId;
  64. }
  65. }