\OCPIAppConfig

This class provides an easy way for apps to store config values in the database.

Summary

Methods
Constants
hasKey()
getValue()
deleteKey()
getKeys()
getValues()
setValue()
getApps()
deleteApp()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

hasKey()

hasKey(string  $app, string  $key) : boolean

check if a key is set in the appconfig

Parameters

string $app
string $key

Returns

boolean

getValue()

getValue(string  $app, string  $key, string  $default = null) : string

Gets the config value

Parameters

string $app

app

string $key

key

string $default

= null, default value if the key does not exist

Returns

string —

the value or $default

deleteKey()

deleteKey(string  $app, string  $key) : boolean

Deletes a key

Parameters

string $app

app

string $key

key

Returns

boolean

getKeys()

getKeys(string  $app) : array

Get the available keys for an app

Parameters

string $app

the app we are looking for

Returns

array —

an array of key names

getValues()

getValues(string|false  $app, string|false  $key) : array|false

get multiply values, either the app or key can be used as wildcard by setting it to false

Parameters

string|false $app
string|false $key

Returns

array|false

setValue()

setValue(string  $app, string  $key, string|float|integer  $value) : void

sets a value in the appconfig

Parameters

string $app

app

string $key

key

string|float|integer $value

value

getApps()

getApps() : array

Get all apps using the config

Returns

array —

an array of app ids

This function returns a list of all apps that have at least one entry in the appconfig table.

deleteApp()

deleteApp(string  $app) : boolean

Remove app from appconfig

Parameters

string $app

app

Returns

boolean