mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
fetch $this->affectedHost->get('id')
only if $this->affectedHost->get('id')
is not null for service set
This commit is contained in:
parent
df08e91bc9
commit
b47478293f
@ -195,7 +195,8 @@ class IcingaServiceSetServiceTable extends ZfQueryBasedTable
|
|||||||
assert($connection instanceof Db);
|
assert($connection instanceof Db);
|
||||||
$builder = new ServiceSetQueryBuilder($connection, $this->branchUuid);
|
$builder = new ServiceSetQueryBuilder($connection, $this->branchUuid);
|
||||||
$query = $builder->selectServicesForSet($this->set);
|
$query = $builder->selectServicesForSet($this->set);
|
||||||
if ($hostId = $this->affectedHost->get('id') !== null) {
|
if ($this->affectedHost) {
|
||||||
|
if ($hostId = $this->affectedHost->get('id')) {
|
||||||
$query->joinLeft(
|
$query->joinLeft(
|
||||||
['hsb' => 'icinga_host_service_blacklist'],
|
['hsb' => 'icinga_host_service_blacklist'],
|
||||||
$this->db()->quoteInto('o.id = hsb.service_id AND hsb.host_id = ?', $hostId),
|
$this->db()->quoteInto('o.id = hsb.service_id AND hsb.host_id = ?', $hostId),
|
||||||
@ -204,6 +205,7 @@ class IcingaServiceSetServiceTable extends ZfQueryBasedTable
|
|||||||
'blacklisted' => "CASE WHEN hsb.service_id IS NULL THEN 'n' ELSE 'y' END"
|
'blacklisted' => "CASE WHEN hsb.service_id IS NULL THEN 'n' ELSE 'y' END"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $query->limit(100);
|
return $query->limit(100);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user