Documentation

IAppConfig
in

Wrapper for AppConfig for the AppFramework

Tags
since
20.0.0

Table of Contents

deleteAppValue()  : void
Delete an app wide defined value
deleteAppValues()  : void
Removes all keys in appconfig belonging to the app
deleteUserValue()  : void
Delete a user value
getAppKeys()  : string[]
Get all keys stored for this app
getAppValue()  : string
Looks up an app wide defined value
getUserValue()  : string
Shortcut for getting a user defined value
setAppValue()  : void
Writes a new app wide value
setUserValue()  : void
Set a user defined value

Methods

deleteAppValue()

Delete an app wide defined value

public deleteAppValue(string $key) : void
Parameters
$key : string

the key of the value, under which it was saved

Tags
since
20.0.0

deleteAppValues()

Removes all keys in appconfig belonging to the app

public deleteAppValues() : void
Tags
since
20.0.0

deleteUserValue()

Delete a user value

public deleteUserValue(string $userId, string $key) : void
Parameters
$userId : string

the userId of the user that we want to store the value under

$key : string

the key under which the value is being stored

Tags
since
20.0.0

getAppKeys()

Get all keys stored for this app

public getAppKeys() : string[]
Tags
since
20.0.0
Return values
string[] —

the keys stored for the app

getAppValue()

Looks up an app wide defined value

public getAppValue(string $key[, string $default = '' ]) : string
Parameters
$key : string

the key of the value, under which it was saved

$default : string = ''

the default value to be returned if the value isn't set

Tags
since
20.0.0
Return values
string —

the saved value

getUserValue()

Shortcut for getting a user defined value

public getUserValue(string $userId, string $key[, mixed $default = '' ]) : string
Parameters
$userId : string

the userId of the user that we want to store the value under

$key : string

the key under which the value is being stored

$default : mixed = ''

the default value to be returned if the value isn't set

Tags
since
20.0.0
Return values
string —

setAppValue()

Writes a new app wide value

public setAppValue(string $key, string $value) : void
Parameters
$key : string

the key of the value, under which will be saved

$value : string

the value that should be stored

Tags
since
20.0.0

setUserValue()

Set a user defined value

public setUserValue(string $userId, string $key, string $value[, string $preCondition = null ]) : void
Parameters
$userId : string

the userId of the user that we want to store the value under

$key : string

the key under which the value is being stored

$value : string

the value that you want to store

$preCondition : string = null

only update if the config value was previously the value passed as $preCondition

Tags
throws
PreConditionNotMetException

if a precondition is specified and is not met

throws
UnexpectedValueException

when trying to store an unexpected value

since
20.0.0

Search results