mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 06:44:33 +02:00
Livestatus\Query: add customvar support
This commit is contained in:
parent
7d02107803
commit
46b047b013
@ -16,6 +16,7 @@ use Exception;
|
|||||||
|
|
||||||
class Query extends SimpleQuery
|
class Query extends SimpleQuery
|
||||||
{
|
{
|
||||||
|
protected $customvars = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Columns that return arrays. Will be decoded.
|
* Columns that return arrays. Will be decoded.
|
||||||
@ -71,7 +72,16 @@ class Query extends SimpleQuery
|
|||||||
public function getColumnAliases()
|
public function getColumnAliases()
|
||||||
{
|
{
|
||||||
$aliases = array();
|
$aliases = array();
|
||||||
|
$hasCustom = false;
|
||||||
foreach ($this->getColumns() as $key => $val) {
|
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)) {
|
if (is_int($key)) {
|
||||||
$aliases[] = $val;
|
$aliases[] = $val;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user