You are here

public static function WebformSubmissionDevelGenerateTrait::create in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php \Drupal\webform\Plugin\DevelGenerate\WebformSubmissionDevelGenerateTrait::create()

File

src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php, line 79

Class

WebformSubmissionDevelGenerateTrait
Provides a WebformSubmissionDevelGenerate plugin.

Namespace

Drupal\webform\Plugin\DevelGenerate

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  $instance = new static($configuration, $plugin_id, $plugin_definition);
  $instance->request = $container
    ->get('request_stack')
    ->getCurrentRequest();
  $instance->database = $container
    ->get('database');
  $instance->entityTypeManager = $container
    ->get('entity_type.manager');
  $instance->messenger = $container
    ->get('messenger');
  $instance->webformSubmissionGenerate = $container
    ->get('webform_submission.generate');
  $instance->webformEntityReferenceManager = $container
    ->get('webform.entity_reference_manager');
  $instance->time = $container
    ->get('datetime.time');
  return $instance;
}