/**
* Get the value of a datalist element.
*
* Plugin authors should use elgg_get_config() and pass null for the site GUID.
*
* @internal Datalists are stored in the datalist table.
*
* @tip Use datalists to store information common to a full installation.
*
* @param string $name The name of the datalist
* @return string|null|false String if value exists, null if doesn't, false on error
* @access private
*/
function get($name)
{
$name = trim($name);
if (!$this->validateName($name)) {
return false;
}
return $this->cache->get($name, function () use($name) {
$escaped_name = $this->db->sanitizeString($name);
$result = $this->db->getDataRow("SELECT * FROM {$this->table} WHERE name = '{$escaped_name}'");
return $result ? $result->value : null;
});
}