IVersion.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
  5. *
  6. * @license GNU AGPL version 3 or any later version
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as
  10. * published by the Free Software Foundation, either version 3 of the
  11. * License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. namespace OCA\Files_Versions\Versions;
  23. use OCP\Files\FileInfo;
  24. use OCP\IUser;
  25. /**
  26. * @since 15.0.0
  27. */
  28. interface IVersion {
  29. /**
  30. * @return IVersionBackend
  31. * @since 15.0.0
  32. */
  33. public function getBackend(): IVersionBackend;
  34. /**
  35. * Get the file info of the source file
  36. *
  37. * @return FileInfo
  38. * @since 15.0.0
  39. */
  40. public function getSourceFile(): FileInfo;
  41. /**
  42. * Get the id of the revision for the file
  43. *
  44. * @return int|string
  45. * @since 15.0.0
  46. */
  47. public function getRevisionId();
  48. /**
  49. * Get the timestamp this version was created
  50. *
  51. * @return int
  52. * @since 15.0.0
  53. */
  54. public function getTimestamp(): int;
  55. /**
  56. * Get the size of this version
  57. *
  58. * @return int
  59. * @since 15.0.0
  60. */
  61. public function getSize(): int;
  62. /**
  63. * Get the name of the source file at the time of making this version
  64. *
  65. * @return string
  66. * @since 15.0.0
  67. */
  68. public function getSourceFileName(): string;
  69. /**
  70. * Get the mimetype of this version
  71. *
  72. * @return string
  73. * @since 15.0.0
  74. */
  75. public function getMimeType(): string;
  76. /**
  77. * Get the path of this version
  78. *
  79. * @return string
  80. * @since 15.0.0
  81. */
  82. public function getVersionPath(): string;
  83. /**
  84. * @return IUser
  85. * @since 15.0.0
  86. */
  87. public function getUser(): IUser;
  88. }