IcingaCommandTable: add distinct template table

This commit is contained in:
Thomas Gelf 2015-08-03 13:31:14 +02:00
parent b78b066f27
commit 3beaeba3d6
2 changed files with 19 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class IcingaCommandTable extends QuickTable
);
}
public function getBaseQuery()
protected function getUnfilteredQuery()
{
$db = $this->connection()->getConnection();
$query = $db->select()->from(
@ -49,4 +49,9 @@ class IcingaCommandTable extends QuickTable
return $query;
}
public function getBaseQuery()
{
return $this->getUnfilteredQuery()->where('c.object_type = ?', 'object');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Icinga\Module\Director\Tables;
use Icinga\Module\Director\Tables\IcingaCommandTable;
class IcingaCommandTemplateTable extends IcingaCommandTable
{
public function getBaseQuery()
{
return $this->getUnfilteredQuery()->where('c.object_type = ?', 'template');
}
}