IcingaObject: fix v1 rendering for some properties

Mostly relations, no timeout, still ugly
This commit is contained in:
Thomas Gelf 2016-10-12 08:31:22 +00:00
parent e096ec9ec5
commit 9e1cea0119
2 changed files with 17 additions and 11 deletions

View File

@ -1405,7 +1405,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
{ {
return $this->renderLegacyObjectProperty( return $this->renderLegacyObjectProperty(
$renderKey ?: $propertyName, $renderKey ?: $propertyName,
c::renderString($this->getRelatedObjectName($propertyName, $id)) c1::renderString($this->getRelatedObjectName($propertyName, $id))
); );
} }
@ -1418,6 +1418,16 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
/** /**
* @codingStandardsIgnoreStart * @codingStandardsIgnoreStart
*/ */
protected function renderLegacyHost_id()
{
return $this->renderLegacyRelationProperty('host', $this->host_id, 'host_name');
}
protected function renderLegacyTimeout()
{
return '';
}
protected function renderLegacyEnable_active_checks() protected function renderLegacyEnable_active_checks()
{ {
return $this->renderLegacyBooleanProperty( return $this->renderLegacyBooleanProperty(
@ -1614,6 +1624,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
} }
} }
if (substr($key, -3) === '_id'
&& $this->hasRelation($relKey = substr($key, 0, -3))
) {
return $this->renderLegacyRelationProperty($relKey, $value);
}
return c1::renderKeyValue($key, c1::renderString($value)); return c1::renderKeyValue($key, c1::renderString($value));
} }

View File

@ -170,14 +170,4 @@ class IcingaServiceSet extends IcingaObject
{ {
return $this->connection->getDefaultGlobalZoneName(); return $this->connection->getDefaultGlobalZoneName();
} }
public function xxisObject()
{
return true;
}
public function getUrlParams()
{
return array('name' => $this->object_name);
}
} }