namespace Wallabag\AnnotationBundle\Repository;
use Doctrine\ORM\EntityRepository;
+use Doctrine\ORM\QueryBuilder;
+use Wallabag\AnnotationBundle\Entity\Annotation;
/**
* AnnotationRepository.
*/
class AnnotationRepository extends EntityRepository
{
- /**
- * Return a query builder to used by other getBuilderFor* method.
- *
- * @param int $userId
- *
- * @return QueryBuilder
- */
- private function getBuilderByUser($userId)
- {
- return $this->createQueryBuilder('a')
- ->leftJoin('a.user', 'u')
- ->andWhere('u.id = :userId')->setParameter('userId', $userId)
- ->orderBy('a.id', 'desc')
- ;
- }
-
/**
* Retrieves all annotations for a user.
*
*
* @return mixed
*/
- public function findAllByArchivedEntriesAndUserId($userId)
+ public function findAllArchivedEntriesByUser($userId)
{
return $this->createQueryBuilder('a')
->leftJoin('a.entry', 'e')
->getQuery()
->getResult();
}
+
+ /**
+ * Return a query builder to used by other getBuilderFor* method.
+ *
+ * @param int $userId
+ *
+ * @return QueryBuilder
+ */
+ private function getBuilderByUser($userId)
+ {
+ return $this->createQueryBuilder('a')
+ ->leftJoin('a.user', 'u')
+ ->andWhere('u.id = :userId')->setParameter('userId', $userId)
+ ->orderBy('a.id', 'desc')
+ ;
+ }
}