From 407d4f98dbd8c5a0b113cdf45ca9ea2d77290b03 Mon Sep 17 00:00:00 2001 From: raviks789 <33730024+raviks789@users.noreply.github.com> Date: Thu, 18 Nov 2021 12:37:09 +0100 Subject: [PATCH] Remove enumHostForServiceList, enumHostList, enumServiceList from EditNodeForm. These methods are present in the trait EnumList and EditNodeForm is already using that trait. --- application/forms/EditNodeForm.php | 56 ------------------------------ 1 file changed, 56 deletions(-) diff --git a/application/forms/EditNodeForm.php b/application/forms/EditNodeForm.php index 0e14d70..2f886fc 100644 --- a/application/forms/EditNodeForm.php +++ b/application/forms/EditNodeForm.php @@ -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 = [