Elgg
Version 1.11
|
Public Member Functions | |
__construct (Pool $cache, Database $db, Logger $logger, $table) | |
Constructor. More... | |
get ($name) | |
Get the value of a datalist element. More... | |
set ($name, $value) | |
Set the value for a datalist element. More... | |
loadAll () | |
Load entire datalist in memory. More... | |
runFunctionOnce ($functionname, $timelastupdatedcheck=0) | |
Run a function one time per installation. More... | |
Definition at line 19 of file Datalist.php.
Constructor.
Pool | $cache | Some kind of caching implementation |
Database | $db | The database |
Logger | $logger | A logger |
string | $table | The name of the datalists table, including prefix |
Definition at line 41 of file Datalist.php.
Elgg\Database\Datalist::get | ( | $name | ) |
Get the value of a datalist element.
Plugin authors should use elgg_get_config() and pass null for the site GUID.
Definition at line 61 of file Datalist.php.
Elgg\Database\Datalist::loadAll | ( | ) |
Load entire datalist in memory.
This could cause OOM problems if the datalists table is large.
Definition at line 124 of file Datalist.php.
Elgg\Database\Datalist::runFunctionOnce | ( | $functionname, | |
$timelastupdatedcheck = 0 |
|||
) |
Run a function one time per installation.
If you pass a timestamp as the second argument, it will run the function only if (i) it has never been run before or (ii) the timestamp is >= the last time it was run.
Use $timelastupdatedcheck in your plugins init function to perform automated upgrades. Schedule a function to run once and pass the timestamp of the new release. This will cause the run once function to be run on all installations. To perform additional upgrades, create new functions for each release.
Definition at line 164 of file Datalist.php.
Elgg\Database\Datalist::set | ( | $name, | |
$value | |||
) |
Set the value for a datalist element.
Plugin authors should use elgg_save_config() and pass null for the site GUID.
string | $name | The name of the datalist |
string | $value | The new value |
Definition at line 93 of file Datalist.php.