From 0b453a3eab7cbcd026184fbd29f8fbc9b7412d77 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 16 Dec 2019 14:38:03 +0100 Subject: [PATCH] CommentController: Call with() only once --- application/controllers/CommentController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/controllers/CommentController.php b/application/controllers/CommentController.php index ab5c57ea..f01b67e9 100644 --- a/application/controllers/CommentController.php +++ b/application/controllers/CommentController.php @@ -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]);