You are here

public function LayoutBuilderBlockSanitizerBatch::batchSanitizeAllNodesStart in Layout Builder Block Sanitizer 8

Kick off batch process to sanitize all nodes on site.

File

src/LayoutBuilderBlockSanitizerBatch.php, line 53

Class

LayoutBuilderBlockSanitizerBatch
Class LayoutBuilderBlockSanitizerBatch.

Namespace

Drupal\layout_builder_block_sanitizer

Code

public function batchSanitizeAllNodesStart() {
  $nodes = $this->layoutBuilderBlockSanitizerManager
    ->getNodes();
  $nids = array_keys($nodes);
  batch_set([
    'title' => $this
      ->t('Sanitizing nodes'),
    'init_message' => $this
      ->t('Beginning node sanitize'),
    'operations' => [
      [
        [
          'Drupal\\layout_builder_block_sanitizer\\LayoutBuilderBlockSanitizerBatch',
          'batchSanitizeAllNodes',
        ],
        [
          $nids,
        ],
      ],
    ],
    'finished' => [
      'Drupal\\layout_builder_block_sanitizer\\LayoutBuilderBlockSanitizerBatch',
      'batchCompleted',
    ],
  ]);
}