class db_text

Manages configuration options with an arbitrary length value stored in a TEXT column. In constrast to class \phpbb\config\db, values are never cached and prefetched, but every get operation sends a query to the database.

Properties

protected driver_interface $db

Database connection

protected string $table

Name of the database table used.

Methods

__construct(driver_interface $db, string $table)

No description

null
set(string $key, string $value)

Sets the configuration option with the name $key to $value.

string|null
get(string $key)

Gets the configuration value for the name $key.

null
delete(string $key)

Removes the configuration option with the name $key.

null
set_array(array $map)

Mass set configuration options: Receives an associative array, treats array keys as configuration option names and associated array values as their configuration option values.

array
get_array(array $keys)

Mass get configuration options: Receives a set of configuration option names and returns the result as a key => value map where array keys are configuration option names and array values are associated config option values.

null
delete_array(array $keys)

Mass delete configuration options.

Details

at line 39
__construct(driver_interface $db, string $table)

No description

Parameters

driver_interface $db

Database connection

string $table

Table name

at line 53
null set(string $key, string $value)

Sets the configuration option with the name $key to $value.

Parameters

string $key

The configuration option's name

string $value

New configuration value

Return Value

null

at line 66
string|null get(string $key)

Gets the configuration value for the name $key.

Parameters

string $key

The configuration option's name

Return Value

string|null

String result on success null if there is no such option

at line 80
null delete(string $key)

Removes the configuration option with the name $key.

Parameters

string $key

The configuration option's name

Return Value

null

at line 94
null set_array(array $map)

Mass set configuration options: Receives an associative array, treats array keys as configuration option names and associated array values as their configuration option values.

Parameters

array $map

Map from configuration names to values

Return Value

null

at line 128
array get_array(array $keys)

Mass get configuration options: Receives a set of configuration option names and returns the result as a key => value map where array keys are configuration option names and array values are associated config option values.

Parameters

array $keys

Set of configuration option names

Return Value

array

Map from configuration names to values

at line 152
null delete_array(array $keys)

Mass delete configuration options.

Parameters

array $keys

Set of configuration option names

Return Value

null