addTitleTab(t('Comment')); $name = $this->params->getRequired('name'); $query = Comment::on($this->getDb())->with([ 'host', 'host.state', 'service', 'service.state', 'service.host', 'service.host.state' ]); $query->filter(Filter::equal('comment.name', $name)); $this->applyRestrictions($query); $comment = $query->first(); if ($comment === null) { throw new NotFoundError(t('Comment not found')); } $this->comment = $comment; } public function indexAction() { $this->addControl((new CommentList([$this->comment])) ->setViewMode('minimal') ->setDetailActionsDisabled() ->setCaptionDisabled() ->setNoSubjectLink()); $this->addContent((new CommentDetail($this->comment))->setTicketLinkEnabled()); $this->setAutorefreshInterval(10); } protected function fetchCommandTargets(): array { return [$this->comment]; } protected function getCommandTargetsUrl(): Url { return Links::comment($this->comment); } }