-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathExAppConfig.php
More file actions
76 lines (62 loc) · 1.95 KB
/
Copy pathExAppConfig.php
File metadata and controls
76 lines (62 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\AppAPI\Db;
use JsonSerializable;
/**
* App configuration value object.
*
* Historically a database entity backed by the `appconfig_ex` table. ExApp config now lives
* in the server's standard `oc_appconfig` (via {@see \OCA\AppAPI\Service\ExAppConfigService});
* this class remains as a plain serializable DTO for OCS responses and internal callers.
*
* The `id` field has no surrogate key anymore (the server table uses a composite primary key);
* it is kept in the serialized shape as `0` for backwards compatibility and is unused.
*/
class ExAppConfig implements JsonSerializable {
private int $id;
private string $appid;
private string $configkey;
private string $configvalue;
private int $sensitive;
public function __construct(array $params = []) {
$this->id = isset($params['id']) ? (int)$params['id'] : 0;
$this->appid = (string)($params['appid'] ?? '');
$this->configkey = (string)($params['configkey'] ?? '');
$this->configvalue = (string)($params['configvalue'] ?? '');
$this->sensitive = (int)($params['sensitive'] ?? 0);
}
public function getId(): int {
return $this->id;
}
public function getAppid(): string {
return $this->appid;
}
public function getConfigkey(): string {
return $this->configkey;
}
public function getConfigvalue(): string {
return $this->configvalue;
}
public function setConfigvalue(string $configValue): void {
$this->configvalue = $configValue;
}
public function getSensitive(): int {
return $this->sensitive;
}
public function setSensitive(int $sensitive): void {
$this->sensitive = $sensitive;
}
public function jsonSerialize(): array {
return [
'id' => $this->id,
'appid' => $this->appid,
'configkey' => $this->configkey,
'configvalue' => $this->configvalue,
'sensitive' => $this->sensitive,
];
}
}