From b1f0fd645f647be4263b2aa942176d8f21d6dc93 Mon Sep 17 00:00:00 2001 From: Olavi Karppi Date: Thu, 6 Mar 2014 22:51:13 +0100 Subject: [PATCH] Fixed syntax error that was occurring when running on top of postgresql, fixes #16 (as described in http://www.doctrine-project.org/jira/browse/DDC-1683) --- Model/Component/Repository/TopicRepository.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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')