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

Manipulates values in the dbprefix_config table. More...

Public Member Functions

 __construct (Database $db, 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'
 

Protected Attributes

Database $db
 
BootService $boot
 

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 ( Database  $db,
BootService  $boot 
)

Constructor.

Parameters
Database$dbDatabase
BootService$bootBootService

Definition at line 35 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 118 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 136 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 50 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 77 of file ConfigTable.php.

Member Data Documentation

BootService Elgg\Database\ConfigTable::$boot
protected

Definition at line 27 of file ConfigTable.php.

Database Elgg\Database\ConfigTable::$db
protected

Definition at line 25 of file ConfigTable.php.

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: