IcingaService: fake isApplyRule for host templates

This commit is contained in:
Thomas Gelf 2016-05-20 15:21:29 +02:00
parent 8c54dcab81
commit 4291f6425e
1 changed files with 10 additions and 16 deletions

View File

@ -85,6 +85,16 @@ class IcingaService extends IcingaObject
);
}
public function isApplyRule()
{
if ($this->hasBeenAssignedToHostTemplate()) {
return true;
}
return $this->hasProperty('object_type')
&& $this->object_type === 'apply';
}
protected function setKey($key)
{
if (is_int($key)) {
@ -121,22 +131,6 @@ class IcingaService extends IcingaObject
return $this->renderRelationProperty('host', $this->host_id, 'host_name');
}
protected function renderObjectHeader()
{
if ($this->hasBeenAssignedToHostTemplate()) {
return sprintf(
"%s %s %s {\n",
'apply',
$this->getType(),
c::renderString($this->getObjectName())
);
} else {
return parent::renderObjectHeader();
}
}
protected function renderAssignments()
{
if (! $this->hasBeenAssignedToHostTemplate()) {