TemplatesTable: allow to filter by inheritance

This commit is contained in:
Thomas Gelf 2017-06-28 00:19:53 +02:00
parent 998bdb193e
commit 652c805387
1 changed files with 16 additions and 0 deletions

View File

@ -3,6 +3,8 @@
namespace Icinga\Module\Director\Web\Table;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
use Icinga\Module\Director\Objects\IcingaObject;
use ipl\Html\Html;
use ipl\Html\Icon;
use ipl\Html\Link;
@ -56,6 +58,20 @@ class TemplatesTable extends ZfQueryBasedTable
]);
}
public function filterTemplate(
IcingaObject $template,
$inheritance = IcingaObjectFilterHelper::INHERIT_DIRECT
) {
IcingaObjectFilterHelper::filterByTemplate(
$this->getQuery(),
$template,
'o',
$inheritance
);
return $this;
}
protected function prepareQuery()
{
$type = $this->getType();