public function getBatch($count = self::BATCH_COUNT, array $filter = null)
{
$qb = $this->createQueryBuilder('a');
if (is_null($filter)) {
$qb->where('a.indexed IS NULL')->orWhere('a.indexed < a.updated')->orderBy('a.number', 'DESC');
} else {
throw new IndexException('Filter is not implemented yet.');
}
if (is_numeric($count)) {
$qb->setMaxResults($count);
}
$batch = $qb->getQuery()->getResult();
return $batch;
}