Livestatus\Query: add customvar support

This commit is contained in:
Thomas Gelf 2014-11-16 16:31:09 +01:00
parent 7d02107803
commit 46b047b013
1 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,7 @@ use Exception;
class Query extends SimpleQuery
{
protected $customvars = array();
/**
* Columns that return arrays. Will be decoded.
@ -71,7 +72,16 @@ class Query extends SimpleQuery
public function getColumnAliases()
{
$aliases = array();
$hasCustom = false;
foreach ($this->getColumns() as $key => $val) {
if ($val[0] === '_') {
$this->customvars[$val] = null;
if (! $hasCustom) {
$aliases[] = 'custom_variables';
$hasCustom = true;
}
continue;
}
if (is_int($key)) {
$aliases[] = $val;
} else {