1
0

Change.php 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Files\Notify;
  7. use OCP\Files\Notify\IChange;
  8. class Change implements IChange {
  9. /** @var int */
  10. private $type;
  11. /** @var string */
  12. private $path;
  13. /**
  14. * Change constructor.
  15. *
  16. * @param int $type
  17. * @param string $path
  18. */
  19. public function __construct($type, $path) {
  20. $this->type = $type;
  21. $this->path = $path;
  22. }
  23. /**
  24. * Get the type of the change
  25. *
  26. * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED
  27. */
  28. public function getType() {
  29. return $this->type;
  30. }
  31. /**
  32. * Get the path of the file that was changed relative to the root of the storage
  33. *
  34. * Note, for rename changes this path is the old path for the file
  35. *
  36. * @return mixed
  37. */
  38. public function getPath() {
  39. return $this->path;
  40. }
  41. }