IcingaObject: introduce isObject helper method

This commit is contained in:
Thomas Gelf 2016-03-20 12:00:03 +01:00
parent 5b9ba4e7e4
commit dda16fd0d0

View File

@ -83,6 +83,8 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
private $resolveCache = array(); private $resolveCache = array();
private $cachedPlainUnmodified;
public function propertyIsBoolean($property) public function propertyIsBoolean($property)
{ {
return array_key_exists($property, $this->booleans); return array_key_exists($property, $this->booleans);
@ -962,6 +964,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return parent::hasProperty($key); return parent::hasProperty($key);
} }
public function isObject()
{
return $this->hasProperty('object_type')
&& $this->object_type === 'object';
}
public function isTemplate() public function isTemplate()
{ {
return $this->hasProperty('object_type') return $this->hasProperty('object_type')