1
0

MaxAutoCompleteResultsInitialState.php 594 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Comments;
  8. use OCP\AppFramework\Services\InitialStateProvider;
  9. use OCP\IConfig;
  10. class MaxAutoCompleteResultsInitialState extends InitialStateProvider {
  11. public function __construct(
  12. private IConfig $config,
  13. ) {
  14. }
  15. public function getKey(): string {
  16. return 'maxAutoCompleteResults';
  17. }
  18. public function getData(): int {
  19. return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
  20. }
  21. }