mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IcingaService: fake isApplyRule for host templates
This commit is contained in:
parent
8c54dcab81
commit
4291f6425e
@ -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)
|
protected function setKey($key)
|
||||||
{
|
{
|
||||||
if (is_int($key)) {
|
if (is_int($key)) {
|
||||||
@ -121,22 +131,6 @@ class IcingaService extends IcingaObject
|
|||||||
return $this->renderRelationProperty('host', $this->host_id, 'host_name');
|
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()
|
protected function renderAssignments()
|
||||||
{
|
{
|
||||||
if (! $this->hasBeenAssignedToHostTemplate()) {
|
if (! $this->hasBeenAssignedToHostTemplate()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user