mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
We need stricter control over Monitoring Object queries
* fromRequest-generated ones are sometimes buggy and sometimes slow * this is just a temporary quickfix for the worst problems
This commit is contained in:
parent
57097bba16
commit
f741bc01f3
@ -142,6 +142,7 @@ abstract class AbstractObject
|
|||||||
|
|
||||||
public function fetchContacts()
|
public function fetchContacts()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
$query = Contact::fromRequest(
|
$query = Contact::fromRequest(
|
||||||
$this->request,
|
$this->request,
|
||||||
array(
|
array(
|
||||||
@ -152,6 +153,21 @@ abstract class AbstractObject
|
|||||||
)
|
)
|
||||||
)->getQuery()
|
)->getQuery()
|
||||||
->where('host_name', $this->host_name);
|
->where('host_name', $this->host_name);
|
||||||
|
*/
|
||||||
|
|
||||||
|
$query = Contact::fromParams(array('backend' => null), array(
|
||||||
|
'contact_name',
|
||||||
|
'contact_alias',
|
||||||
|
'contact_email',
|
||||||
|
'contact_pager',
|
||||||
|
))->getQuery();
|
||||||
|
|
||||||
|
if ($this->type === 'service') {
|
||||||
|
$query->where('service_host_name', $this->host_name);
|
||||||
|
$query->where('service_description', $this->service_description);
|
||||||
|
} else {
|
||||||
|
$query->where('host_name', $this->host_name);
|
||||||
|
}
|
||||||
|
|
||||||
$this->contacts = $query->fetchAll();
|
$this->contacts = $query->fetchAll();
|
||||||
return $this;
|
return $this;
|
||||||
@ -173,6 +189,19 @@ abstract class AbstractObject
|
|||||||
|
|
||||||
public function fetchContactgroups()
|
public function fetchContactgroups()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$query = Contactgroup::fromParams(array('backend' => null), array(
|
||||||
|
'contactgroup_name',
|
||||||
|
'contactgroup_alias'
|
||||||
|
))->getQuery();
|
||||||
|
|
||||||
|
if ($this->type === 'service') {
|
||||||
|
$query->where('service_host_name', $this->host_name);
|
||||||
|
$query->where('service_description', $this->service_description);
|
||||||
|
} else {
|
||||||
|
$query->where('host_name', $this->host_name);
|
||||||
|
}
|
||||||
|
/*
|
||||||
$query = Contactgroup::fromRequest(
|
$query = Contactgroup::fromRequest(
|
||||||
$this->request,
|
$this->request,
|
||||||
array(
|
array(
|
||||||
@ -180,7 +209,7 @@ abstract class AbstractObject
|
|||||||
'contactgroup_alias'
|
'contactgroup_alias'
|
||||||
)
|
)
|
||||||
)->getQuery();
|
)->getQuery();
|
||||||
|
*/
|
||||||
$this->contactgroups = $query->fetchAll();
|
$this->contactgroups = $query->fetchAll();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user