You are here

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

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

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

Overrides ContentEntityForm::create

File

src/WebformSubmissionForm.php, line 200

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

public static function create(ContainerInterface $container) {
  $instance = parent::create($container);
  $instance->configFactory = $container
    ->get('config.factory');
  $instance->renderer = $container
    ->get('renderer');
  $instance->formBuilder = $container
    ->get('form_builder');
  $instance->killSwitch = $container
    ->get('page_cache_kill_switch');
  $instance->aliasManager = $container
    ->get('path_alias.manager');
  $instance->pathValidator = $container
    ->get('path.validator');
  $instance->selectionManager = $container
    ->get('plugin.manager.entity_reference_selection');
  $instance->entityFieldManager = $container
    ->get('entity_field.manager');
  $instance->requestHandler = $container
    ->get('webform.request');
  $instance->elementManager = $container
    ->get('plugin.manager.webform.element');
  $instance->thirdPartySettingsManager = $container
    ->get('webform.third_party_settings_manager');
  $instance->messageManager = $container
    ->get('webform.message_manager');
  $instance->tokenManager = $container
    ->get('webform.token_manager');
  $instance->conditionsValidator = $container
    ->get('webform_submission.conditions_validator');
  $instance->webformEntityReferenceManager = $container
    ->get('webform.entity_reference_manager');
  $instance->generate = $container
    ->get('webform_submission.generate');
  return $instance;
}