You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.9 KiB

3 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2019 Robin Appelman <robin@icewind.nl>
  5. *
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Robin Appelman <robin@icewind.nl>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OC\Files\Cache;
  27. use OCP\EventDispatcher\Event;
  28. use OCP\Files\Cache\ICacheEvent;
  29. use OCP\Files\Storage\IStorage;
  30. class AbstractCacheEvent extends Event implements ICacheEvent {
  31. protected $storage;
  32. protected $path;
  33. protected $fileId;
  34. /**
  35. * @param IStorage $storage
  36. * @param string $path
  37. * @param int $fileId
  38. * @since 16.0.0
  39. */
  40. public function __construct(IStorage $storage, string $path, int $fileId) {
  41. $this->storage = $storage;
  42. $this->path = $path;
  43. $this->fileId = $fileId;
  44. }
  45. /**
  46. * @return IStorage
  47. * @since 16.0.0
  48. */
  49. public function getStorage(): IStorage {
  50. return $this->storage;
  51. }
  52. /**
  53. * @return string
  54. * @since 16.0.0
  55. */
  56. public function getPath(): string {
  57. return $this->path;
  58. }
  59. /**
  60. * @param string $path
  61. * @since 19.0.0
  62. */
  63. public function setPath(string $path): void {
  64. $this->path = $path;
  65. }
  66. /**
  67. * @return int
  68. * @since 16.0.0
  69. */
  70. public function getFileId(): int {
  71. return $this->fileId;
  72. }
  73. }