function 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 313

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.