IcingaObject: fix resolveProperty in combination...

...with lazy-set properties
This commit is contained in:
Thomas Gelf 2016-05-26 01:35:12 +02:00
parent 123b4c7549
commit cb825b5b94
1 changed files with 5 additions and 0 deletions

View File

@ -610,6 +610,11 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
public function getResolvedProperty($key, $default = null)
{
if (array_key_exists($key, $this->unresolvedRelatedProperties)) {
$this->resolveUnresolvedRelatedProperty($key);
$this->invalidateResolveCache();
}
$properties = $this->getResolvedProperties();
if (property_exists($properties, $key)) {
return $properties->$key;