You are here

public function BatchService::processEntityTypeReindex in Taxonomy Entity Index 8

Batch process callback.

Parameters

int $batch_id: ID of the batch.

string $entity_type: The entity type.

int $entity_id: The entity ID.

object $context: Context for operations.

File

src/BatchService.php, line 22

Class

BatchService
Class BatchService.

Namespace

Drupal\taxonomy_entity_index

Code

public function processEntityTypeReindex($batch_id, $entity_type, $entity_id, &$context) {
  $context['results'][] = $batch_id;
  $context['message'] = t('Running Batch @batch_id: type: @entity_type - id: @entity_id', [
    '@batch_id' => $batch_id,
    '@entity_type' => $entity_type,
    '@entity_id' => $entity_id,
  ]);
  $entity = \Drupal::entityTypeManager()
    ->getStorage($entity_type)
    ->load($entity_id);
  taxonomy_entity_index_entity_update($entity);
}