You are here

protected function FeaturesGenerator::getGenerationMethodInstance in Features 8.3

Same name and namespace in other branches
  1. 8.4 src/FeaturesGenerator.php \Drupal\features\FeaturesGenerator::getGenerationMethodInstance()

Returns an instance of the specified package generation method.

Parameters

string $method_id: The string identifier of the package generation method to use to package configuration.

Return value

\Drupal\features\FeaturesGenerationMethodInterface

2 calls to FeaturesGenerator::getGenerationMethodInstance()
FeaturesGenerator::applyExportFormSubmit in src/FeaturesGenerator.php
Responds to the submission of \Drupal\features_ui\Form\FeaturesExportForm.
FeaturesGenerator::applyGenerationMethod in src/FeaturesGenerator.php
Apply a given package generation method.

File

src/FeaturesGenerator.php, line 132

Class

FeaturesGenerator
Class responsible for performing package generation.

Namespace

Drupal\features

Code

protected function getGenerationMethodInstance($method_id) {
  if (!isset($this->methods[$method_id])) {
    $instance = $this->generatorManager
      ->createInstance($method_id, []);
    $instance
      ->setFeaturesManager($this->featuresManager);
    $instance
      ->setAssigner($this->assigner);
    $this->methods[$method_id] = $instance;
  }
  return $this->methods[$method_id];
}