ProcessBundle/Task/AbstractEAVQueryTask.php
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;
    }
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;
    }
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 ; }
If a limit or an offset is specified, we are forced to use a paginator to handle joins properly

@param ProcessState $state
@param string       $alias

@throws \InvalidArgumentException
@throws \UnexpectedValueException
@throws \Sidus\EAVModelBundle\Exception\MissingAttributeException
@throws \LogicException
@throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface

@return Paginator
If a limit or an offset is specified we are forced to use a paginator to handle joins properly