phpBB API Documentation
Class

phpbb\config\db_text

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.

Methods

__construct(driver_interface $db, string $table)

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
public __construct(driver_interface $db, string $table)

Parameters

driver_interface $db Database connection
string $table Table name

at line 53
public 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
public 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
public 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
public 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
public 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
public null delete_array(array $keys)

Mass delete configuration options.

Parameters

array $keys Set of configuration option names

Return Value

null