for GET /api/entries, star, delete and archive status are no more necessary

This commit is contained in:
Nicolas Lœuillet
2015-02-04 18:06:42 +01:00
parent 42a9064620
commit 6e334aba68
3 changed files with 16 additions and 11 deletions

View File

@ -86,13 +86,19 @@ class EntriesRepository extends EntityRepository
//TODO tous les paramètres ne sont pas utilisés, à corriger
$qb = $this->createQueryBuilder('e')
->select('e')
->where('e.isFav =:isStarred')->setParameter('isStarred', $isStarred)
->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived)
->andWhere('e.userId =:userId')->setParameter('userId', $userId)
->andWhere('e.isDeleted=0')
->where('e.userId =:userId')->setParameter('userId', $userId)
->andWhere('e.isDeleted=0');
if (!is_null($isArchived)) {
$qb->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived);
}
if (!is_null($isStarred)) {
$qb->andWhere('e.isFav =:isStarred')->setParameter('isStarred', $isStarred);
}
return $qb
->getQuery()
->getResult(Query::HYDRATE_ARRAY);
return $qb;
}
}