12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- declare(strict_types=1);
- namespace OCP\Settings\Events;
- use Exception;
- use OCP\EventDispatcher\Event;
- use OCP\IUser;
- use OCP\Settings\IDeclarativeSettingsForm;
- class DeclarativeSettingsGetValueEvent extends Event {
-
- private mixed $value = null;
-
- public function __construct(
- private IUser $user,
- private string $app,
- private string $formId,
- private string $fieldId,
- ) {
- parent::__construct();
- }
-
- public function getUser(): IUser {
- return $this->user;
- }
-
- public function getApp(): string {
- return $this->app;
- }
-
- public function getFormId(): string {
- return $this->formId;
- }
-
- public function getFieldId(): string {
- return $this->fieldId;
- }
-
- public function setValue(mixed $value): void {
- $this->value = $value;
- }
-
- public function getValue(): mixed {
- if ($this->value === null) {
- throw new Exception('Value not set');
- }
- return $this->value;
- }
- }
|