mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-27 17:18:54 -04:00
CommentController: Already fetch required relations with the first query
This commit is contained in:
parent
61b50abd2b
commit
382f2ef198
1 changed files with 8 additions and 1 deletions
|
|
@ -27,7 +27,14 @@ class CommentController extends Controller
|
|||
|
||||
$name = $this->params->shiftRequired('name');
|
||||
|
||||
$query = Comment::on($this->getDb())->with(['host', 'host.state']);
|
||||
$query = Comment::on($this->getDb())->with([
|
||||
'host',
|
||||
'host.state',
|
||||
'service',
|
||||
'service.state',
|
||||
'service.host',
|
||||
'service.host.state'
|
||||
]);
|
||||
|
||||
$query->getSelectBase()
|
||||
->where(['comment.name = ?' => $name]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue