PublicCalendarRoot.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\DAV\CalDAV;
  8. use OCP\IConfig;
  9. use OCP\IL10N;
  10. use Psr\Log\LoggerInterface;
  11. use Sabre\DAV\Collection;
  12. class PublicCalendarRoot extends Collection {
  13. /**
  14. * PublicCalendarRoot constructor.
  15. *
  16. * @param CalDavBackend $caldavBackend
  17. * @param IL10N $l10n
  18. * @param IConfig $config
  19. */
  20. public function __construct(
  21. protected CalDavBackend $caldavBackend,
  22. protected IL10N $l10n,
  23. protected IConfig $config,
  24. private LoggerInterface $logger,
  25. ) {
  26. }
  27. /**
  28. * @inheritdoc
  29. */
  30. public function getName() {
  31. return 'public-calendars';
  32. }
  33. /**
  34. * @inheritdoc
  35. */
  36. public function getChild($name) {
  37. $calendar = $this->caldavBackend->getPublicCalendar($name);
  38. return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger);
  39. }
  40. /**
  41. * @inheritdoc
  42. */
  43. public function getChildren() {
  44. return [];
  45. }
  46. }