IcingaServiceSet: createWhere() look for template

...in case no host_id has been set
This commit is contained in:
Thomas Gelf 2017-08-27 18:59:32 +02:00
parent 6685066673
commit c2afacc11b
1 changed files with 12 additions and 0 deletions

View File

@ -249,6 +249,18 @@ class IcingaServiceSet extends IcingaObject
}
}
public function createWhere()
{
$where = parent::createWhere();
if (! $this->hasBeenLoadedFromDb()) {
if (null === $this->get('host_id') && null === $this->get('id')) {
$where .= " AND object_type = 'template'";
}
}
return $where;
}
protected function beforeStore()
{
parent::beforeStore();