selectNextLanguage example

        $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);
    }

    /** * @param array<string> $ids */
    public function updateIds(EntityDefinition $definition, array $ids): void
    {
        
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(),
            ],
            [
                
Feature::triggerDeprecationOrThrow('v6.6.0.0', 'Passing definitions objects is deprecated. Pass the entity name instead.');
                $mapping[] = $mappingDefinition->getEntityDefinition()->getEntityName();
            } else {
                $mapping[] = $mappingDefinition;
            }
        }

        $this->allDefinitions = $mapping;
        $this->definitions = $mapping;

        if (!Feature::isActive('ES_MULTILINGUAL_INDEX')) {
            $this->selectNextLanguage();
        }

        $this->selectNextDefinition();
    }

    /** * @deprecated tag:v6.6.0 - Will be removed. Use selectNextDefinition instead * * @phpstan-ignore-next-line ignore needs to be removed when deprecation is removed */
    public function setNextDefinition(): ?string
    {
Home | Imprint | This part of the site doesn't use cookies.