mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
IcingaObject: failsafe helper for related object
This commit is contained in:
parent
4119fee9bb
commit
1dbf2e8410
@ -202,6 +202,17 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
||||
return $class::loadWithAutoIncId($id, $this->connection);
|
||||
}
|
||||
|
||||
public function getResolvedRelated($property)
|
||||
{
|
||||
$id = $this->getResolvedProperty($property . '_id');
|
||||
|
||||
if ($id) {
|
||||
return $this->getRelatedObject($property, $id);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function supportsCustomVars()
|
||||
{
|
||||
return $this->supportsCustomVars;
|
||||
|
Loading…
x
Reference in New Issue
Block a user