IcingaObject: prepare command object access
This commit is contained in:
parent
4f64d79e15
commit
d23149bf3e
|
@ -66,6 +66,20 @@ class IcingaHost extends IcingaObject
|
|||
return $properties;
|
||||
}
|
||||
|
||||
public function getCheckCommand()
|
||||
{
|
||||
$id = $this->getResolvedProperty('check_command_id');
|
||||
return IcingaCommand::loadWithAutoIncId(
|
||||
$id,
|
||||
$this->getConnection()
|
||||
);
|
||||
}
|
||||
|
||||
public function hasCheckCommand()
|
||||
{
|
||||
return $this->getResolvedProperty('check_command_id') !== null;
|
||||
}
|
||||
|
||||
protected function renderCheck_command_id()
|
||||
{
|
||||
return $this->renderCommandProperty($this->check_command_id);
|
||||
|
|
|
@ -199,6 +199,16 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getResolvedProperty($key)
|
||||
{
|
||||
$properties = $this->getResolvedProperties();
|
||||
if (property_exists($properties, $key)) {
|
||||
return $properties->$key;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getResolvedProperties()
|
||||
{
|
||||
return $this->getResolved('Properties');
|
||||
|
@ -685,6 +695,11 @@ return '';
|
|||
return substr($this->getType(), -5) === 'Group';
|
||||
}
|
||||
|
||||
public function hasCheckCommand()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getType()
|
||||
{
|
||||
if ($this->type === null) {
|
||||
|
|
Loading…
Reference in New Issue