function RecipeRunner::installContent

Same name in other branches
  1. 10 core/lib/Drupal/Core/Recipe/RecipeRunner.php \Drupal\Core\Recipe\RecipeRunner::installContent()

Installs a content for a recipe.

Parameters

\Drupal\Core\Recipe\Recipe $recipe: The recipe to install content for.

array<mixed>|null $context: The batch context if called by a batch.

File

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

Class

RecipeRunner
Applies a recipe.

Namespace

Drupal\Core\Recipe

Code

public static function installContent(Recipe $recipe, ?array &$context = NULL) : void {
    static::processContent($recipe->content);
    $context['message'] = t('Created content for %recipe recipe.', [
        '%recipe' => $recipe->name,
    ]);
    $context['results']['content'][] = $recipe->name;
}

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