IcingaObject: add generic helper methods

This commit is contained in:
Thomas Gelf 2015-06-08 13:02:09 +02:00
parent 46b356f4b8
commit 26621f5ab1
1 changed files with 19 additions and 0 deletions

View File

@ -10,6 +10,25 @@ abstract class IcingaObject extends DbObject
protected $autoincKeyName = 'id'; protected $autoincKeyName = 'id';
protected $supportsCustomVars = false;
public function supportsCustomVars()
{
return $this->supportsCustomVars;
}
public function isTemplate()
{
return property_exists($this, 'object_type')
&& $this->object_type === 'template';
}
public function isApplyRule()
{
return property_exists($this, 'object_type')
&& $this->object_type === 'apply';
}
public function onInsert() public function onInsert()
{ {
DirectorActivityLog::logCreation($this, $this->connection); DirectorActivityLog::logCreation($this, $this->connection);