Newscoop\Entity\Repository\ArticleRepository::getBatch PHP Метод

getBatch() публичный Метод

Get articles for indexing.
public getBatch ( integer $count = self::BATCH_COUNT, array $filter = null ) : array
$count integer Number of articles to index
$filter array Filter to apply to articles
Результат array
    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;
    }