CloudFederationNotification.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Federation;
  7. use OCP\Federation\ICloudFederationNotification;
  8. /**
  9. * Class CloudFederationNotification
  10. *
  11. * @package OC\Federation
  12. *
  13. * @since 14.0.0
  14. */
  15. class CloudFederationNotification implements ICloudFederationNotification {
  16. private $message = [];
  17. /**
  18. * add a message to the notification
  19. *
  20. * @param string $notificationType (e.g. SHARE_ACCEPTED)
  21. * @param string $resourceType (e.g. file, calendar, contact,...)
  22. * @param string $providerId id of the share
  23. * @param array $notification payload of the notification
  24. *
  25. * @since 14.0.0
  26. */
  27. public function setMessage($notificationType, $resourceType, $providerId, array $notification) {
  28. $this->message = [
  29. 'notificationType' => $notificationType,
  30. 'resourceType' => $resourceType,
  31. 'providerId' => $providerId,
  32. 'notification' => $notification,
  33. ];
  34. }
  35. /**
  36. * get message, ready to send out
  37. *
  38. * @return array
  39. *
  40. * @since 14.0.0
  41. */
  42. public function getMessage() {
  43. return $this->message;
  44. }
  45. }