DeclarativeSettingsRegisterFormEvent.php 827 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Settings\Events;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\Settings\IDeclarativeManager;
  10. use OCP\Settings\IDeclarativeSettingsForm;
  11. /**
  12. * @psalm-import-type DeclarativeSettingsFormSchemaWithoutValues from IDeclarativeSettingsForm
  13. *
  14. * @since 29.0.0
  15. */
  16. class DeclarativeSettingsRegisterFormEvent extends Event {
  17. /**
  18. * @since 29.0.0
  19. */
  20. public function __construct(private IDeclarativeManager $manager) {
  21. parent::__construct();
  22. }
  23. /**
  24. * @param DeclarativeSettingsFormSchemaWithoutValues $schema
  25. * @since 29.0.0
  26. */
  27. public function registerSchema(string $app, array $schema): void {
  28. $this->manager->registerSchema($app, $schema);
  29. }
  30. }