Elgg
Version 2.3
|
Public Member Functions | |
__construct (Pool $cache, Database $db, Logger $logger, $table) | |
Constructor. More... | |
setCache (Pool $pool) | |
Set cache. More... | |
get ($name) | |
Get the value of a datalist element. More... | |
set ($name, $value) | |
Set the value for a datalist element. More... | |
runFunctionOnce ($functionname, $timelastupdatedcheck=0) | |
Run a function one time per installation. More... | |
Public Attributes | |
const | MAX_NAME_LENGTH = 255 |
Protected Member Functions | |
validateName ($name) | |
Verify a datalist name is valid. More... | |
Protected Attributes | |
$cache | |
$db | |
$logger | |
$table | |
Definition at line 20 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 44 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 77 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 161 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 110 of file Datalist.php.
Elgg\Database\Datalist::setCache | ( | Pool | $pool | ) |
Set cache.
The BootService injects a pre-populated cache here. The constructor requires a cache as well because the installer doesn't fully boot.
Pool | $pool | Cache |
Definition at line 60 of file Datalist.php.
|
protected |
Verify a datalist name is valid.
string | $name | Datalist name to be checked |
Definition at line 187 of file Datalist.php.
|
protected |
Definition at line 25 of file Datalist.php.
|
protected |
Definition at line 28 of file Datalist.php.
|
protected |
Definition at line 31 of file Datalist.php.
|
protected |
Definition at line 34 of file Datalist.php.
const Elgg\Database\Datalist::MAX_NAME_LENGTH = 255 |
Definition at line 22 of file Datalist.php.