IVersion.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Files_Versions\Versions;
  8. use OCP\Files\FileInfo;
  9. use OCP\IUser;
  10. /**
  11. * @since 15.0.0
  12. */
  13. interface IVersion {
  14. /**
  15. * @return IVersionBackend
  16. * @since 15.0.0
  17. */
  18. public function getBackend(): IVersionBackend;
  19. /**
  20. * Get the file info of the source file
  21. *
  22. * @return FileInfo
  23. * @since 15.0.0
  24. */
  25. public function getSourceFile(): FileInfo;
  26. /**
  27. * Get the id of the revision for the file
  28. *
  29. * @return int|string
  30. * @since 15.0.0
  31. */
  32. public function getRevisionId();
  33. /**
  34. * Get the timestamp this version was created
  35. *
  36. * @return int
  37. * @since 15.0.0
  38. */
  39. public function getTimestamp(): int;
  40. /**
  41. * Get the size of this version
  42. *
  43. * @return int|float
  44. * @since 15.0.0
  45. */
  46. public function getSize(): int|float;
  47. /**
  48. * Get the name of the source file at the time of making this version
  49. *
  50. * @return string
  51. * @since 15.0.0
  52. */
  53. public function getSourceFileName(): string;
  54. /**
  55. * Get the mimetype of this version
  56. *
  57. * @return string
  58. * @since 15.0.0
  59. */
  60. public function getMimeType(): string;
  61. /**
  62. * Get the path of this version
  63. *
  64. * @return string
  65. * @since 15.0.0
  66. */
  67. public function getVersionPath(): string;
  68. /**
  69. * @return IUser
  70. * @since 15.0.0
  71. */
  72. public function getUser(): IUser;
  73. }