Private GIT

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

API - Add getparam function in centreonTimePeriod class

parent 96a664af
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,7 @@ class CentreonTimePeriod extends CentreonObject ...@@ -78,6 +78,7 @@ class CentreonTimePeriod extends CentreonObject
$this->insertParams = array("tp_name", "tp_alias"); $this->insertParams = array("tp_name", "tp_alias");
$this->exportExcludedParams = array_merge($this->insertParams, array($this->object->getPrimaryKey())); $this->exportExcludedParams = array_merge($this->insertParams, array($this->object->getPrimaryKey()));
$this->action = "TP"; $this->action = "TP";
$this->dbTablePrefix = "tp_";
$this->nbOfCompulsoryParams = count($this->insertParams); $this->nbOfCompulsoryParams = count($this->insertParams);
} }
...@@ -152,6 +153,26 @@ class CentreonTimePeriod extends CentreonObject ...@@ -152,6 +153,26 @@ class CentreonTimePeriod extends CentreonObject
} }
} }
/**
* Get parameters
*
* @param string $parameters
* @return array parameters
* @throws CentreonClapiException
*/
public function getparam($parameters)
{
$params = explode($this->delim, $parameters);
$objectId = $this->getObjectId($params[self::ORDER_UNIQUENAME]);
$allParams = array('tp_id', 'tp_name', 'tp_alias', 'tp_sunday', 'tp_monday', 'tp_tuesday', 'tp_wednesday',
'tp_thursday', 'tp_friday', 'tp_saturday');
if ($this->isGetParam($objectId, $this->dbTablePrefix, $params, $allParams)) {
parent::getparam($objectId, array($this->dbTablePrefix.$params[1]));
} else {
throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ":" . $params[self::ORDER_UNIQUENAME]);
}
}
/** /**
* Set Exception * Set Exception
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment