Elgg  Version master
Public Member Functions | Public Attributes | List of all members
Elgg\Database\ConfigTable Class Reference

Manipulates values in the dbprefix_config table. More...

Public Member Functions

 __construct (protected Database $db, protected BootService $boot)
 Constructor. More...
 
 remove (string $name)
 Removes a config setting. More...
 
 set (string $name, $value)
 Add or update a config setting. More...
 
 get (string $name)
 Gets a configuration value. More...
 
 getAll ()
 Load all config values from the config table. More...
 

Public Attributes

const TABLE_NAME = 'config'
 

Detailed Description

Manipulates values in the dbprefix_config table.

Do not use to read/write $CONFIG.

Definition at line 16 of file ConfigTable.php.

Constructor & Destructor Documentation

Elgg\Database\ConfigTable::__construct ( protected Database  $db,
protected BootService  $boot 
)

Constructor.

Parameters
Database$dbDatabase
BootService$bootBootService

Definition at line 31 of file ConfigTable.php.

Member Function Documentation

Elgg\Database\ConfigTable::get ( string  $name)

Gets a configuration value.

Plugin authors should use elgg_get_config().

Note
Internal: These settings are stored in the dbprefix_config table and read during system boot into the config service.
Parameters
string$nameThe name of the config value
Returns
mixed|null

Definition at line 112 of file ConfigTable.php.

Elgg\Database\ConfigTable::getAll ( )

Load all config values from the config table.

Returns
array
See also
::__construct sets this

Definition at line 130 of file ConfigTable.php.

Elgg\Database\ConfigTable::remove ( string  $name)

Removes a config setting.

Parameters
string$nameThe name of the field.
Returns
bool

Definition at line 44 of file ConfigTable.php.

Elgg\Database\ConfigTable::set ( string  $name,
  $value 
)

Add or update a config setting.

Plugin authors should use elgg_save_config().

If the config name already exists, it will be updated to the new value.

Note
Internal: These settings are stored in the dbprefix_config table and read during system boot into the config service.
Internal: The value is serialized so we maintain type information.
Parameters
string$nameThe name of the configuration value (cannot be greater than 255 characters)
mixed$valueIts value
Returns
bool
Exceptions
InvalidArgumentException

Definition at line 71 of file ConfigTable.php.

Member Data Documentation

const Elgg\Database\ConfigTable::TABLE_NAME = 'config'

Definition at line 23 of file ConfigTable.php.


The documentation for this class was generated from the following file: