public function FeaturesGenerator::applyGenerationMethod in Features 8.4
Same name and namespace in other branches
- 8.3 src/FeaturesGenerator.php \Drupal\features\FeaturesGenerator::applyGenerationMethod()
Apply a given package generation method.
Parameters
string $method_id: The string identifier of the package generation method to use to package configuration.
array $packages: Array of package data.
\Drupal\features\FeaturesBundleInterface $bundle: The optional bundle used for the generation. Used to generate profiles.
Return value
array Array of results for profile and/or packages, each result including the following keys:
- 'success': boolean TRUE or FALSE for successful writing.
- 'display': boolean TRUE if the message should be displayed to the user, otherwise FALSE.
- 'message': a message about the result of the operation.
- 'variables': an array of substitutions to be used in the message.
Overrides FeaturesGeneratorInterface::applyGenerationMethod
1 call to FeaturesGenerator::applyGenerationMethod()
- FeaturesGenerator::generate in src/
FeaturesGenerator.php - Generates a file representation of configuration packages and, optionally, an install profile.
File
- src/
FeaturesGenerator.php, line 102
Class
- FeaturesGenerator
- Class responsible for performing package generation.
Namespace
Drupal\featuresCode
public function applyGenerationMethod($method_id, array $packages = [], FeaturesBundleInterface $bundle = NULL) {
$method = $this
->getGenerationMethodInstance($method_id);
$method
->prepare($packages, $bundle);
return $method
->generate($packages, $bundle);
}