You are here

public static function WebformEntityHandler::create in Webform Entity Handler 8

Same name and namespace in other branches
  1. 2.x src/Plugin/WebformHandler/WebformEntityHandler.php \Drupal\webform_entity_handler\Plugin\WebformHandler\WebformEntityHandler::create()

Creates an instance of the plugin.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the plugin.

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Return value

static Returns an instance of this plugin.

Overrides WebformHandlerBase::create

File

src/Plugin/WebformHandler/WebformEntityHandler.php, line 81

Class

WebformEntityHandler
Create or update an entity with a webform submission values.

Namespace

Drupal\webform_entity_handler\Plugin\WebformHandler

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
  $instance
    ->setEntityFieldManager($container
    ->get('entity_field.manager'));
  $instance
    ->setEntityTypeBundleInfo($container
    ->get('entity_type.bundle.info'));
  $instance
    ->setEntityTypeManager($container
    ->get('entity_type.manager'));
  $instance
    ->setWebformElementManager($container
    ->get('plugin.manager.webform.element'));
  $instance
    ->setWebformTokenManager($container
    ->get('webform.token_manager'));
  return $instance;
}