protected function getPaginator(ProcessState $state, $alias = 'e')
    {
        $options = $this->getOptions($state);
        /** @noinspection PhpDeprecationInspection */
        $paginator = new Paginator($this->getQueryBuilder($state, $alias));
        if (null !== $options['limit']) {
            $paginator->getQuery()->setMaxResults($options['limit']);
        }
        if (null !== $options['offset']) {
            $paginator->getQuery()->setFirstResult($options['offset']);
        }

        return $paginator;
    }