IcingaService: render service_description for v1

This commit is contained in:
Thomas Gelf 2016-11-07 11:38:02 +01:00
parent 482f48ee1e
commit 2c1f745c4e
2 changed files with 20 additions and 2 deletions

View File

@ -2060,12 +2060,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
if ($this->isTemplate()) {
$name = c1::renderKeyValue(
'name',
$this->getLegacyObjectKeyName(),
c1::renderString($this->getObjectName())
);
} else {
$name = c1::renderKeyValue(
$type . '_name',
$this->getLegacyObjectKeyName(),
c1::renderString($this->getObjectName())
);
}
@ -2083,6 +2083,15 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return $str;
}
protected function getLegacyObjectKeyName()
{
if ($this->isTemplate()) {
return 'name';
} else {
return $this->getLegacyObjectType() . '_name';
}
}
/**
* @codingStandardsIgnoreStart
*/

View File

@ -257,6 +257,15 @@ class IcingaService extends IcingaObject
return parent::renderObjectHeader();
}
protected function getLegacyObjectKeyName()
{
if ($this->isTemplate()) {
return 'name';
} else {
return 'service_description';
}
}
protected function hasBeenAssignedToHostTemplate()
{
return $this->host_id && $this->getRelatedObject(