mirror of
https://github.com/nextcloud/server.git
synced 2026-11-26 16:15:53 +01:00
Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Joas Schilling <coding@schilljs.com>
62 lines
1.1 KiB
PHP
62 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCP\Config;
|
|
|
|
use OCP\AppFramework\Attribute\Listenable;
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
/**
|
|
* Emitted before an admin deletes an app config value via occ or the provisioning API.
|
|
* Listeners can refuse the change with setValid(false).
|
|
*
|
|
* @since 36.0.0
|
|
*/
|
|
#[Listenable(since: '36.0.0')]
|
|
class BeforeAppConfigDeletedEvent extends Event {
|
|
protected bool $valid = true;
|
|
|
|
/**
|
|
* @since 36.0.0
|
|
*/
|
|
public function __construct(
|
|
protected string $appId,
|
|
protected string $configKey,
|
|
) {
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* @since 36.0.0
|
|
*/
|
|
public function getAppId(): string {
|
|
return $this->appId;
|
|
}
|
|
|
|
/**
|
|
* @since 36.0.0
|
|
*/
|
|
public function getConfigKey(): string {
|
|
return $this->configKey;
|
|
}
|
|
|
|
/**
|
|
* @since 36.0.0
|
|
*/
|
|
public function isRejected(): bool {
|
|
return !$this->valid;
|
|
}
|
|
|
|
/**
|
|
* @since 36.0.0
|
|
*/
|
|
public function setValid(bool $valid): void {
|
|
$this->valid = $valid;
|
|
}
|
|
}
|