diff --git a/Model/Component/Repository/TopicRepository.php b/Model/Component/Repository/TopicRepository.php index 9f8b448..b79b487 100644 --- a/Model/Component/Repository/TopicRepository.php +++ b/Model/Component/Repository/TopicRepository.php @@ -44,10 +44,10 @@ public function findAllTopicsPaginatedByBoardId($boardId, $page, $itemsPerPage = throw new \Exception('Board id "' . $boardId . '" is invalid!'); } - $params = array(':boardId' => $boardId, ':isSticky' => false); - $qb = $this->createSelectQuery(array('t', 'b', 'c', 'fp', 'fp_author', 'lp', 'lp_author', 't_closedBy', 't_deletedBy', 't_stickiedBy')); + $params = array(':boardId' => $boardId, ':isSticky' => $qb->expr()->literal(false)); + $qb ->innerJoin('t.firstPost', 'fp') ->leftJoin('fp.createdBy', 'fp_author') @@ -97,10 +97,10 @@ public function findAllTopicsStickiedByBoardId($boardId, $canViewDeletedTopics = throw new \Exception('Board id "' . $boardId . '" is invalid!'); } - $params = array(':boardId' => $boardId, ':isSticky' => true); - $qb = $this->createSelectQuery(array('t', 'b', 'c', 'fp', 'fp_author', 'lp', 'lp_author', 't_closedBy', 't_deletedBy', 't_stickiedBy')); + $params = array(':boardId' => $boardId, ':isSticky' => $qb->expr()->literal(true)); + $qb ->innerJoin('t.firstPost', 'fp') ->leftJoin('fp.createdBy', 'fp_author')