Private GIT

Skip to content
Snippets Groups Projects
Commit 96a664af authored by Laurent Pinsivy's avatar Laurent Pinsivy
Browse files

API - Add getparam function in centreonCommand class

parent 7f1120f4
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ class CentreonCommand extends CentreonObject
array($this->object->getPrimaryKey(), "graph_id", "cmd_cat_id")
);
$this->action = "CMD";
$this->dbTablePrefix = "command_";
$this->nbOfCompulsoryParams = count($this->insertParams);
$this->typeConversion = array(
"notif" => 1,
......@@ -188,6 +189,27 @@ class CentreonCommand extends CentreonObject
}
}
/**
* Get parameters
*
* @param string $parameters
* @throws CentreonClapiException
*/
public function getparam($parameters)
{
$params = explode($this->delim, $parameters);
$objectId = $this->getObjectId($params[self::ORDER_UNIQUENAME]);
if ($this->isGetParam($objectId, $this->dbTablePrefix, $params, $this->insertParams)) {
if ($params[1] == "type") {
parent::getparam($objectId, array($this->dbTablePrefix.$params[1]), $this->typeConversion);
} else {
parent::getparam($objectId, array($this->dbTablePrefix.$params[1]));
}
} else {
throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ":" . $params[self::ORDER_UNIQUENAME]);
}
}
/**
* Returns command id
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment