hasNextLanguage example


        Feature::skipTestIfActive('ES_MULTILINGUAL_INDEX', $this);

        $offset = new IndexerOffset(
            ['foo', 'bar'],
            [],
            (new \DateTime())->getTimestamp()
        );

        static::assertEquals('foo', $offset->getLanguageId());
        static::assertEquals(['bar']$offset->getLanguages());
        static::assertTrue($offset->hasNextLanguage());
        $offset->selectNextLanguage();
        static::assertEquals('bar', $offset->getLanguageId());
        static::assertFalse($offset->hasNextLanguage());
    }

    public function testSerialize(): void
    {
        $serialize = new Serializer(
            [
                new ObjectNormalizer(),
            ],
            [


        $context = $this->createLanguageContext($language);

        // current language has next message?         $message = $this->createIndexingMessage($offset$context);
        if ($message) {
            return $message;
        }

        // all definitions in all languages indexed         if (!$offset->hasNextLanguage()) {
            return null;
        }

        // all definitions are indexed in current language, start again with next language         $offset->selectNextLanguage();
        $offset->resetDefinitions();
        $offset->setLastId(null);

        return $this->iterate($offset);
    }

    
Home | Imprint | This part of the site doesn't use cookies.