diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index ac8eaadf..8727fd5c 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -72,10 +72,14 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer } protected function getRelatedObjectName($property, $id) + { + return $this->getRelatedObject($property, $id)->object_name; + } + + protected function getRelatedObject($property, $id) { $class = $this->getRelationClass($property); - $object = $class::loadWithAutoIncId($id, $this->connection); - return $object->object_name; + return $class::loadWithAutoIncId($id, $this->connection); } public function supportsCustomVars()