ActivitySettingsAdapter.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 OC\Activity;
  8. use OCP\Activity\ActivitySettings;
  9. use OCP\Activity\ISetting;
  10. use OCP\IL10N;
  11. /**
  12. * Adapt the old interface based settings into the new abstract
  13. * class based one
  14. */
  15. class ActivitySettingsAdapter extends ActivitySettings {
  16. public function __construct(
  17. private ISetting $oldSettings,
  18. private IL10N $l10n,
  19. ) {
  20. }
  21. public function getIdentifier() {
  22. return $this->oldSettings->getIdentifier();
  23. }
  24. public function getName() {
  25. return $this->oldSettings->getName();
  26. }
  27. public function getGroupIdentifier() {
  28. return 'other';
  29. }
  30. public function getGroupName() {
  31. return $this->l10n->t('Other activities');
  32. }
  33. public function getPriority() {
  34. return $this->oldSettings->getPriority();
  35. }
  36. public function canChangeMail() {
  37. return $this->oldSettings->canChangeMail();
  38. }
  39. public function isDefaultEnabledMail() {
  40. return $this->oldSettings->isDefaultEnabledMail();
  41. }
  42. }