1
0

IResource.php 783 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 OCP\Collaboration\Resources;
  8. use OCP\IUser;
  9. /**
  10. * @since 16.0.0
  11. */
  12. interface IResource {
  13. /**
  14. * @return string
  15. * @since 16.0.0
  16. */
  17. public function getType(): string;
  18. /**
  19. * @return string
  20. * @since 16.0.0
  21. */
  22. public function getId(): string;
  23. /**
  24. * @return array
  25. * @since 16.0.0
  26. */
  27. public function getRichObject(): array;
  28. /**
  29. * Can a user/guest access the resource
  30. *
  31. * @param IUser|null $user
  32. * @return bool
  33. * @since 16.0.0
  34. */
  35. public function canAccess(?IUser $user): bool;
  36. /**
  37. * @return ICollection[]
  38. * @since 16.0.0
  39. */
  40. public function getCollections(): array;
  41. }