Ugly temporary fix for Monitoring\Object problems
This commit is contained in:
parent
8ccd748310
commit
23daa39205
|
@ -42,6 +42,18 @@ abstract class AbstractObject
|
|||
|
||||
public function fetchComments()
|
||||
{
|
||||
// WTF???
|
||||
$query = Comment::fromParams(array('backend' => null), array(
|
||||
'comment_timestamp',
|
||||
'comment_author',
|
||||
'comment_data',
|
||||
'comment_type',
|
||||
))->getQuery();
|
||||
$query->where('comment_objecttype_id', $this->type);
|
||||
$this->applyObjectFilter($query);
|
||||
$this->comments = $query->fetchAll();
|
||||
return $this;
|
||||
|
||||
$this->comments = Comment::fromRequest(
|
||||
$this->request,
|
||||
array(
|
||||
|
@ -52,7 +64,7 @@ abstract class AbstractObject
|
|||
'comment_type',
|
||||
)
|
||||
)->getQuery()
|
||||
->where('comment_objecttype_id', 1)
|
||||
//->where('comment_objecttype_id', 1)
|
||||
|
||||
->fetchAll();
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Icinga\Module\Monitoring\Object;
|
||||
|
||||
use Icinga\Module\Monitoring\DataView\HostStatus;
|
||||
use Icinga\Data\Db\Query;
|
||||
|
||||
class Host extends AbstractObject
|
||||
{
|
||||
|
@ -11,6 +12,10 @@ class Host extends AbstractObject
|
|||
public $prefix = 'host_';
|
||||
private $view = null;
|
||||
|
||||
protected function applyObjectFilter(Query $query)
|
||||
{
|
||||
return $query->where('host_name', $this->host_name);
|
||||
}
|
||||
|
||||
public function populate()
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Icinga\Module\Monitoring\Object;
|
||||
|
||||
use Icinga\Module\Monitoring\DataView\ServiceStatus;
|
||||
use Icinga\Data\Db\Query;
|
||||
|
||||
class Service extends AbstractObject
|
||||
{
|
||||
|
@ -11,6 +12,12 @@ class Service extends AbstractObject
|
|||
public $prefix = 'service_';
|
||||
private $view = null;
|
||||
|
||||
protected function applyObjectFilter(Query $query)
|
||||
{
|
||||
return $query->where('service_host_name', $this->host_name)
|
||||
->where('service_description', $this->service_description);
|
||||
}
|
||||
|
||||
public function populate()
|
||||
{
|
||||
$this->fetchComments()
|
||||
|
|
Loading…
Reference in New Issue