IcingaObject: add helper for related objects
This commit is contained in:
parent
afe0bfb373
commit
7b6747ab67
|
@ -72,10 +72,14 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getRelatedObjectName($property, $id)
|
protected function getRelatedObjectName($property, $id)
|
||||||
|
{
|
||||||
|
return $this->getRelatedObject($property, $id)->object_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getRelatedObject($property, $id)
|
||||||
{
|
{
|
||||||
$class = $this->getRelationClass($property);
|
$class = $this->getRelationClass($property);
|
||||||
$object = $class::loadWithAutoIncId($id, $this->connection);
|
return $class::loadWithAutoIncId($id, $this->connection);
|
||||||
return $object->object_name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsCustomVars()
|
public function supportsCustomVars()
|
||||||
|
|
Loading…
Reference in New Issue