Settings
in package
Table of Contents
Constants
- MINECRAFT_INTEGRATION = 'mc_integration'
Properties
- $_cached_settings : array<string|int, mixed>|null
Methods
- get() : string|null
- Get a setting from the database table `nl2_settings`.
- set() : void
- Modify a setting in the database table `nl2_settings`.
- getSettingsCache() : array<string|int, mixed>
- hasSettingsCache() : bool
- setSettingsCache() : void
Constants
MINECRAFT_INTEGRATION
public
mixed
MINECRAFT_INTEGRATION
= 'mc_integration'
Properties
$_cached_settings
private
static array<string|int, mixed>|null
$_cached_settings
= \null
Methods
get()
Get a setting from the database table `nl2_settings`.
public
static get(string $setting[, string|null $fallback = null ][, string $module = 'core' ]) : string|null
Parameters
- $setting : string
-
Setting to check.
- $fallback : string|null = null
-
Fallback to return if $setting is not set in DB. Defaults to null.
- $module : string = 'core'
-
Module name to keep settings separate from other modules. Set module to 'Core' for global settings.
Return values
string|null —Setting from DB or $fallback.
set()
Modify a setting in the database table `nl2_settings`.
public
static set(string $setting, string|null $new_value[, string $module = 'core' ]) : void
Parameters
- $setting : string
-
Setting name.
- $new_value : string|null
-
New setting value, or null to delete
- $module : string = 'core'
-
Module name to keep settings separate from other modules. Set module to 'Core' for global settings.
getSettingsCache()
private
static & getSettingsCache(string|null $module) : array<string|int, mixed>
Parameters
- $module : string|null
Return values
array<string|int, mixed>hasSettingsCache()
private
static hasSettingsCache(string|null $module) : bool
Parameters
- $module : string|null
Return values
boolsetSettingsCache()
private
static setSettingsCache(string|null $module, array<string|int, mixed> $cache) : void
Parameters
- $module : string|null
- $cache : array<string|int, mixed>