function RecipeRunner::toBatchOperations

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Recipe/RecipeRunner.php \Drupal\Core\Recipe\RecipeRunner::toBatchOperations()

Converts a recipe into a series of batch operations.

Parameters

\Drupal\Core\Recipe\Recipe $recipe: The recipe to convert to batch operations.

Return value

array<int, array{0: callable, 1: array{mixed}}> The array of batch operations. Each value is an array with two values. The first value is a callable and the second value are the arguments to pass to the callable.

See also

\Drupal\Core\Batch\BatchBuilder::addOperation()

3 calls to RecipeRunner::toBatchOperations()
install_recipe_batch in core/includes/install.core.inc
Creates a batch for the recipe system to process.
RecipeCommand::execute in core/lib/Drupal/Core/Recipe/RecipeCommand.php
RecipeRunnerTest::testRecipesAreDisambiguatedByPath in core/tests/Drupal/KernelTests/Core/Recipe/RecipeRunnerTest.php

File

core/lib/Drupal/Core/Recipe/RecipeRunner.php, line 147

Class

RecipeRunner
Applies a recipe.

Namespace

Drupal\Core\Recipe

Code

public static function toBatchOperations(Recipe $recipe) : array {
    $modules = [];
    $themes = [];
    $recipes = [];
    return static::toBatchOperationsRecipe($recipe, $recipes, $modules, $themes);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.