public function next()
    {
        $this->currentChunk = $this->syncStorage->getChunk(1, $this->documentType, $this->shopId);

        if (empty($this->currentChunk)) {
            $this->valid = false;

            return;
        }

        $this->currentEntity = $this
            ->entityManager
            ->getRepository($this->entityClass)->find($this->currentChunk[0]['document_id']);

        if (!empty($this->currentEntity) || $this->currentChunk[0]['type'] == ActionTypes::DELETE) {
            $this->valid = true;

            return;
        }

        $this->valid = false;
    }
public function next()
    {
        $this->currentChunk = $this->syncStorage->getChunk(1, $this->documentType, $this->shopId);

        if (empty($this->currentChunk)) {
            $this->valid = false;

            return;
        }

        $this->currentEntity = $this
            ->entityManager
            ->getRepository($this->entityClass)->find($this->currentChunk[0]['document_id']);

        if (!empty($this->currentEntity) || $this->currentChunk[0]['type'] == ActionTypes::DELETE) {
            $this->valid = true;

            return;
        }

        $this->valid = false;
    }
{@inheritdoc}