HiddenSettings
in component
Hidden values of a module in the admin area and in the catalog: the installed version, counters and other values that are not fields of the module settings page.
The values are stored in the OpenCart setting table of the default store (store_id 0) in the group
'<ext_code>_hidden' under the keys '<ext_code>hidden
The values are loaded into the store config at the start of a request like other settings
('<ext_code>hidden
Example:
use \extension\ka_extensions\HiddenSettings;
HiddenSettings::set('mymodule', 'last_run', date('Y-m-d'));
$last_run = HiddenSettings::get('mymodule', 'last_run'); // '2026-10-28'
$requests = HiddenSettings::increase('mymodule', 'requests'); // atomic +1, the new value
Table of Contents
Methods
- get() : mixed
- Returns the hidden value $key of the module or $default when it is not stored.
- increase() : mixed
- Adds $add to a numeric hidden value with one UPDATE (value = value + $add), so parallel requests
do not lose increments. A missing value is created with $add. Returns the new value. - set() : mixed
- Stores one hidden value of the module, other values are kept. Arrays are stored as JSON,
other values as strings. A null value removes the key.
Methods
get()
Returns the hidden value $key of the module or $default when it is not stored.
public
static get(mixed $ext_code, mixed $key[, mixed $default = null ]) : mixed
Parameters
- $ext_code : mixed
- $key : mixed
- $default : mixed = null
increase()
Adds $add to a numeric hidden value with one UPDATE (value = value + $add), so parallel requests do not lose increments. A missing value is created with $add. Returns the new value.
public
static increase(mixed $ext_code, mixed $key[, mixed $add = 1 ]) : mixed
Parameters
- $ext_code : mixed
- $key : mixed
- $add : mixed = 1
set()
Stores one hidden value of the module, other values are kept. Arrays are stored as JSON, other values as strings. A null value removes the key.
public
static set(mixed $ext_code, mixed $key, mixed $value) : mixed
Parameters
- $ext_code : mixed
- $key : mixed
- $value : mixed