From a45b17fcd0e3ed2023e39df2a1de8a91d06851ee Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 4 Sep 2014 12:54:52 +0200 Subject: [PATCH] monitoring/lib: Add methods `Service::getHostName()' and `Service::getName()' The upcoming service command objects will require a service object. In order to build the command string, the service command objects require retrieval of the service's host name and the service's name. The actual implementation of the methods is subject to change refs #6593 --- .../library/Monitoring/Object/Service.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 598bb384d..bfc8325db 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -119,4 +119,24 @@ class Service extends AbstractObject return $this->view->getQuery()->fetchRow(); } + + /** + * Get the host name the service is running on + * + * @return string + */ + public function getHostName() + { + return $this->params->get('host'); + } + + /** + * Get the service name + * + * @return string + */ + public function getName() + { + return $this->params->get('service'); + } }