2017-10-27 07:50:38 -04:00
|
|
|
<?php
|
2021-03-09 15:04:31 -05:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2017-10-27 07:50:38 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-10-27 07:50:38 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\Comments;
|
|
|
|
|
|
2021-03-09 15:04:31 -05:00
|
|
|
use OCP\AppFramework\Services\InitialStateProvider;
|
2020-07-16 11:08:03 -04:00
|
|
|
use OCP\IConfig;
|
2017-10-27 07:50:38 -04:00
|
|
|
|
2021-03-09 15:04:31 -05:00
|
|
|
class MaxAutoCompleteResultsInitialState extends InitialStateProvider {
|
2023-07-07 14:54:48 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private IConfig $config,
|
|
|
|
|
) {
|
2017-10-27 07:50:38 -04:00
|
|
|
}
|
|
|
|
|
|
2021-03-09 15:04:31 -05:00
|
|
|
public function getKey(): string {
|
|
|
|
|
return 'maxAutoCompleteResults';
|
|
|
|
|
}
|
2017-10-27 07:50:38 -04:00
|
|
|
|
2021-03-09 15:04:31 -05:00
|
|
|
public function getData(): int {
|
|
|
|
|
return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
|
2017-10-27 07:50:38 -04:00
|
|
|
}
|
|
|
|
|
}
|