/**
  * @inheritDoc
  */
 public function getThreads(ThreadListQuery $threadListQuery)
 {
     $repository = $this->repositories->threads();
     $criteria = ['board' => $threadListQuery->getBoard()];
     $limit = $threadListQuery->getSeek()->getLimit();
     $offset = $threadListQuery->getSeek()->getOffset();
     $threads = $repository->findBy($criteria, null, $limit, $offset);
     $countQuery = $repository->createQueryBuilder('t');
     $countQuery->select('count(t.id)')->where('t.board = :board')->setParameter('board', $threadListQuery->getBoard());
     $total = (int) $countQuery->getQuery()->getSingleScalarResult();
     return new QueryList($threads, $total);
 }