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.

AbstractCacheEvent.php 1.7KB

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