getIndexingBehavior example

ReplicaConnection::ensurePrimary();

        $context = clone $context;

        $this->loopOperations($operations$context);

        if (\count($behavior->getSkipIndexers())) {
            $context->addExtension(EntityIndexerRegistry::EXTENSION_INDEXER_SKIP, new ArrayEntity(['skips' => $behavior->getSkipIndexers()]));
        }

        if (
            $behavior->getIndexingBehavior() !== null
            && \in_array($behavior->getIndexingBehavior()[EntityIndexerRegistry::DISABLE_INDEXING, EntityIndexerRegistry::USE_INDEXING_QUEUE], true)
        ) {
            $context->addState($behavior->getIndexingBehavior());
        }

        $result = $this->writer->sync($operations, WriteContext::createFromContext($context));

        $writes = EntityWrittenContainerEvent::createWithWrittenEvents($result->getWritten()$context[]);
        $deletes = EntityWrittenContainerEvent::createWithDeletedEvents($result->getDeleted()$context[]);

        if ($deletes->getEvents() !== null) {
            
Home | Imprint | This part of the site doesn't use cookies.