IMetadataVersionBackend.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2024 Eduardo Morales <emoral435@gmail.com>
  5. *
  6. * @license GNU AGPL-3.0-or-later
  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\Node;
  24. /**
  25. * This interface edits the metadata column of a node.
  26. * Each column of the metadata has a key => value mapping.
  27. * @since 29.0.0
  28. */
  29. interface IMetadataVersionBackend {
  30. /**
  31. * Sets a key value pair in the metadata column corresponding to the node's version.
  32. *
  33. * @param Node $node the node that triggered the Metadata event listener, aka, the file version
  34. * @param int $revision the key for the json value of the metadata column
  35. * @param string $key the key for the json value of the metadata column
  36. * @param string $value the value that corresponds to the key in the metadata column
  37. * @since 29.0.0
  38. */
  39. public function setMetadataValue(Node $node, int $revision, string $key, string $value): void;
  40. }