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();