mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 03:09:11 +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);
|
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()
|
public function supportsCustomVars()
|
||||||
{
|
{
|
||||||
return $this->supportsCustomVars;
|
return $this->supportsCustomVars;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user