summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/hardwarequery.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2021-09-24 16:42:50 +0200
committerSimon Rettberg2021-09-24 16:42:50 +0200
commit755cab15d44d5a4e15a9ff0302861dc686e47b57 (patch)
tree9a3c4acd97fe9ad4bc3e4523e75d7d759010f3a2 /modules-available/statistics/inc/hardwarequery.inc.php
parent[statistics/passthrough] WIP (diff)
downloadslx-admin-755cab15d44d5a4e15a9ff0302861dc686e47b57.tar.gz
slx-admin-755cab15d44d5a4e15a9ff0302861dc686e47b57.tar.xz
slx-admin-755cab15d44d5a4e15a9ff0302861dc686e47b57.zip
[statistics/passthrough] WIP
Diffstat (limited to 'modules-available/statistics/inc/hardwarequery.inc.php')
-rw-r--r--modules-available/statistics/inc/hardwarequery.inc.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules-available/statistics/inc/hardwarequery.inc.php b/modules-available/statistics/inc/hardwarequery.inc.php
index c7ecb35e..f0a73d27 100644
--- a/modules-available/statistics/inc/hardwarequery.inc.php
+++ b/modules-available/statistics/inc/hardwarequery.inc.php
@@ -13,7 +13,7 @@ class HardwareQuery
* @param string $type type form HardwareInfo
* @param ?string $uuid
*/
- public function __construct($type, $uuid = null, $connectedOnly = true)
+ public function __construct(string $type, $uuid = null, $connectedOnly = true)
{
if ($connectedOnly) {
$this->joins['mxhw_join'] = "INNER JOIN machine_x_hw mxhw ON (mxhw.hwid = shw.hwid AND mxhw.disconnecttime = 0)";
@@ -120,6 +120,14 @@ class HardwareQuery
$this->columns[$prop] = "$tid.`value` AS `$prop`";
}
+ public function addMachineColumn(string $column)
+ {
+ if (isset($this->columns[$column]))
+ return;
+ $this->joins['machine'] = 'INNER JOIN machine m USING (machineuuid)';
+ $this->columns[$column] = "m.$column";
+ }
+
/**
* @return false|PDOStatement
*/