mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
Livestatus\Query: parse an array structure
This commit is contained in:
parent
1b8449009c
commit
23546a4224
@ -20,6 +20,28 @@ class Query extends SimpleQuery
|
|||||||
return $this->columns;
|
return $this->columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the given encoded array
|
||||||
|
*
|
||||||
|
* @param string $str the encoded array string
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function parseArray($str)
|
||||||
|
{
|
||||||
|
if (empty($str)) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
$entries = preg_split('/,/', $str);
|
||||||
|
foreach ($entries as $e) {
|
||||||
|
$result[] = preg_split('/;/', $e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
public function getColumnAliases()
|
public function getColumnAliases()
|
||||||
{
|
{
|
||||||
$aliases = array();
|
$aliases = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user