From b6eab22ff06ea6a9b2a30c9c72993027a7b5730b Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Wed, 25 Sep 2013 23:43:34 +0200 Subject: [PATCH] finish refactoring --- Repository/PostRepository.php | 4 ++-- Tagging/PHPCRStringStrategy.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Repository/PostRepository.php b/Repository/PostRepository.php index f09d5b2..90dd36a 100644 --- a/Repository/PostRepository.php +++ b/Repository/PostRepository.php @@ -14,10 +14,10 @@ public function searchQuery($options) $qb = $this->createQueryBuilder('a'); if ($options['blog_id']) { - $qb->where()->descendant('a.' . $options['blog_id']); + $qb->where()->descendant($options['blog_id'], 'a'); } - $qb->orderBy()->descending()->field('a.date'); + $qb->orderBy()->desc()->field('a.date'); return $qb->getQuery(); } diff --git a/Tagging/PHPCRStringStrategy.php b/Tagging/PHPCRStringStrategy.php index c5f5338..1fab388 100644 --- a/Tagging/PHPCRStringStrategy.php +++ b/Tagging/PHPCRStringStrategy.php @@ -18,7 +18,7 @@ public function getWeightedTags($blogId) { $qb = $this->postRep->createQueryBuilder('a'); $qb->select('tags'); - $qb->where()->descendant('a', $blogId); // select only children of given blog + $qb->where()->descendant($blogId, 'a'); // select only children of given blog $q = $qb->getQuery(); $res = $q->getPhpcrNodeResult(); $rows = $res->getRows();