From 3beaeba3d6bc8756355cc3a91f04f2aed569e5c7 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 3 Aug 2015 13:31:14 +0200 Subject: [PATCH] IcingaCommandTable: add distinct template table --- application/tables/IcingaCommandTable.php | 7 ++++++- application/tables/IcingaCommandTemplateTable.php | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 application/tables/IcingaCommandTemplateTable.php diff --git a/application/tables/IcingaCommandTable.php b/application/tables/IcingaCommandTable.php index a034a3e5..7e594496 100644 --- a/application/tables/IcingaCommandTable.php +++ b/application/tables/IcingaCommandTable.php @@ -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'); + } } diff --git a/application/tables/IcingaCommandTemplateTable.php b/application/tables/IcingaCommandTemplateTable.php new file mode 100644 index 00000000..b94814f8 --- /dev/null +++ b/application/tables/IcingaCommandTemplateTable.php @@ -0,0 +1,13 @@ +getUnfilteredQuery()->where('c.object_type = ?', 'template'); + } +}