mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-10 07:24:26 +02:00
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…
x
Reference in New Issue
Block a user