Remove enumHostForServiceList, enumHostList, enumServiceList from EditNodeForm.

These methods are present in the trait EnumList and EditNodeForm is already using that trait.
This commit is contained in:
raviks789 2021-11-18 12:37:09 +01:00
parent 3904791438
commit 407d4f98db

View file

@ -348,43 +348,6 @@ class EditNodeForm extends QuickForm
return $this;
}
protected function enumHostForServiceList()
{
$names = $this->backend
->select()
->from('hostStatus', ['hostname' => 'host_name'])
->applyFilter($this->getRestriction('monitoring/filter/objects'))
->order('host_name')
->getQuery()
->fetchColumn();
// fetchPairs doesn't seem to work when using the same column with
// different aliases twice
return array_combine((array) $names, (array) $names);
}
protected function enumHostList()
{
$names = $this->backend
->select()
->from('hostStatus', ['hostname' => 'host_name'])
->applyFilter($this->getRestriction('monitoring/filter/objects'))
->order('host_name')
->getQuery()
->fetchColumn();
// fetchPairs doesn't seem to work when using the same column with
// different aliases twice
$res = array();
$suffix = ';Hoststatus';
foreach ($names as $name) {
$res[$name . $suffix] = $name;
}
return $res;
}
protected function enumHostStateList()
{
$hostStateList = [
@ -396,25 +359,6 @@ class EditNodeForm extends QuickForm
return $hostStateList;
}
protected function enumServiceList($host)
{
$names = $this->backend
->select()
->from('serviceStatus', ['service' => 'service_description'])
->where('host_name', $host)
->applyFilter($this->getRestriction('monitoring/filter/objects'))
->order('service_description')
->getQuery()
->fetchColumn();
$services = array();
foreach ($names as $name) {
$services[$host . ';' . $name] = $name;
}
return $services;
}
protected function enumServiceStateList()
{
$serviceStateList = [