mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Add a new method getAllUserValues($userId) to IConfig
The method was already there in AllConfig but private Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
6e47104bb6
commit
d630af4ca8
2 changed files with 15 additions and 3 deletions
|
|
@ -319,7 +319,7 @@ class AllConfig implements \OCP\IConfig {
|
|||
* @return string
|
||||
*/
|
||||
public function getUserValue($userId, $appName, $key, $default = '') {
|
||||
$data = $this->getUserValues($userId);
|
||||
$data = $this->getAllUserValues($userId);
|
||||
if (isset($data[$appName][$key])) {
|
||||
return $data[$appName][$key];
|
||||
} else {
|
||||
|
|
@ -335,7 +335,7 @@ class AllConfig implements \OCP\IConfig {
|
|||
* @return string[]
|
||||
*/
|
||||
public function getUserKeys($userId, $appName) {
|
||||
$data = $this->getUserValues($userId);
|
||||
$data = $this->getAllUserValues($userId);
|
||||
if (isset($data[$appName])) {
|
||||
return array_keys($data[$appName]);
|
||||
} else {
|
||||
|
|
@ -406,7 +406,7 @@ class AllConfig implements \OCP\IConfig {
|
|||
* [ $key => $value ]
|
||||
* ]
|
||||
*/
|
||||
private function getUserValues($userId) {
|
||||
public function getAllUserValues(string $userId): array {
|
||||
if (isset($this->userCache[$userId])) {
|
||||
return $this->userCache[$userId];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,6 +216,18 @@ interface IConfig {
|
|||
*/
|
||||
public function getUserKeys($userId, $appName);
|
||||
|
||||
/**
|
||||
* Get all user configs sorted by app of one user
|
||||
*
|
||||
* @param string $userId the userId of the user that we want to get all values from
|
||||
* @return array[] - 2 dimensional array with the following structure:
|
||||
* [ $appId =>
|
||||
* [ $key => $value ]
|
||||
* ]
|
||||
* @since 24.0.0
|
||||
*/
|
||||
public function getAllUserValues(string $userId): array;
|
||||
|
||||
/**
|
||||
* Delete a user value
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue