IcingaObject: new helper method for single...

...resolved custom vars
This commit is contained in:
Thomas Gelf 2016-10-20 01:37:23 +00:00
parent 32790dbedc
commit fc2890d865
1 changed files with 15 additions and 0 deletions

View File

@ -832,6 +832,21 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
}
}
public function getResolvedVar($varname)
{
try {
$vars = $this->getResolvedVars();
} catch (NestingError $e) {
return null;
}
if (property_exists($vars, $varname)) {
return $vars->$varname;
} else {
return null;
}
}
public function getOriginForVar($varname)
{
try {