diff options
Diffstat (limited to 'library/Director/Web/Table/ObjectsTableHostTemplateChoice.php')
-rw-r--r-- | library/Director/Web/Table/ObjectsTableHostTemplateChoice.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/library/Director/Web/Table/ObjectsTableHostTemplateChoice.php b/library/Director/Web/Table/ObjectsTableHostTemplateChoice.php new file mode 100644 index 0000000..929e050 --- /dev/null +++ b/library/Director/Web/Table/ObjectsTableHostTemplateChoice.php @@ -0,0 +1,27 @@ +<?php + +namespace Icinga\Module\Director\Web\Table; + +use Zend_Db_Select as ZfSelect; + +class ObjectsTableHostTemplateChoice extends ObjectsTable +{ + protected $columns = [ + 'object_name' => 'o.object_name', + 'templates' => 'GROUP_CONCAT(t.object_name)' + ]; + + protected function applyObjectTypeFilter(ZfSelect $query, ZfSelect $right = null) + { + return $query; + } + + protected function prepareQuery() + { + return parent::prepareQuery()->joinLeft( + ['t' => 'icinga_host'], + 't.template_choice_id = o.id', + [] + )->group('o.id'); + } +} |