summaryrefslogtreecommitdiffstats
path: root/library/Icingadb/Hook/HostsDetailExtensionHook.php
blob: 79c091e147b8e0eeadbdfa5cfb1e6a5ec4e252ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

/* Icinga DB Web | (c) 2021 Icinga GmbH | GPLv2 */

namespace Icinga\Module\Icingadb\Hook;

use Icinga\Module\Icingadb\Hook\ExtensionHook\ObjectsDetailExtensionHook;
use Icinga\Module\Icingadb\Model\Host;
use ipl\Html\ValidHtml;
use ipl\Orm\Query;

abstract class HostsDetailExtensionHook extends ObjectsDetailExtensionHook
{
    /**
     * Assemble and return an HTML representation of the given hosts
     *
     * The given query is already pre-filtered with the user's custom filter and restrictions. The base filter does
     * only contain the user's custom filter, use this for e.g. subsidiary links.
     *
     * The query is also limited by default, use `$hosts->limit(null)` to clear that. But beware that this may yield
     * a huge result set in case of a bulk selection.
     *
     * @param Query<Host> $hosts
     *
     * @return ValidHtml
     */
    abstract public function getHtmlForObjects(Query $hosts): ValidHtml;
}