CommentController: Call with() only once

This commit is contained in:
Eric Lippmann 2019-12-16 14:38:03 +01:00
parent 23c498c3b9
commit 0b453a3eab

View file

@ -27,9 +27,7 @@ class CommentController extends Controller
$name = $this->params->shiftRequired('name');
$query = Comment::on($this->getDb())
->with('host')
->with('host.state');
$query = Comment::on($this->getDb())->with(['host', 'host.state']);
$query->getSelectBase()
->where(['comment.name = ?' => $name]);