1
0

CalendarShareUpdatedEvent.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\Events;
  8. use OCP\EventDispatcher\Event;
  9. use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp;
  10. use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet;
  11. /**
  12. * Class CalendarShareUpdatedEvent
  13. *
  14. * @package OCA\DAV\Events
  15. * @since 20.0.0
  16. */
  17. class CalendarShareUpdatedEvent extends Event {
  18. private int $calendarId;
  19. /** @var array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string } */
  20. private array $calendarData;
  21. /** @var list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}> */
  22. private array $oldShares;
  23. /** @var list<array{href: string, commonName: string, readOnly: bool}> */
  24. private array $added;
  25. /** @var list<string> */
  26. private array $removed;
  27. /**
  28. * CalendarShareUpdatedEvent constructor.
  29. *
  30. * @param int $calendarId
  31. * @param array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string } $calendarData
  32. * @param list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}> $oldShares
  33. * @param list<array{href: string, commonName: string, readOnly: bool}> $added
  34. * @param list<string> $removed
  35. * @since 20.0.0
  36. */
  37. public function __construct(int $calendarId,
  38. array $calendarData,
  39. array $oldShares,
  40. array $added,
  41. array $removed) {
  42. parent::__construct();
  43. $this->calendarId = $calendarId;
  44. $this->calendarData = $calendarData;
  45. $this->oldShares = $oldShares;
  46. $this->added = $added;
  47. $this->removed = $removed;
  48. }
  49. /**
  50. * @since 20.0.0
  51. */
  52. public function getCalendarId(): int {
  53. return $this->calendarId;
  54. }
  55. /**
  56. * @return array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string }
  57. * @since 20.0.0
  58. */
  59. public function getCalendarData(): array {
  60. return $this->calendarData;
  61. }
  62. /**
  63. * @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
  64. * @since 20.0.0
  65. */
  66. public function getOldShares(): array {
  67. return $this->oldShares;
  68. }
  69. /**
  70. * @return list<array{href: string, commonName: string, readOnly: bool}>
  71. * @since 20.0.0
  72. */
  73. public function getAdded(): array {
  74. return $this->added;
  75. }
  76. /**
  77. * @return list<string>
  78. * @since 20.0.0
  79. */
  80. public function getRemoved(): array {
  81. return $this->removed;
  82. }
  83. }