IcingaObject: add generic helper methods
This commit is contained in:
parent
46b356f4b8
commit
26621f5ab1
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue