You are here

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

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

IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database connection is not serializable." exceptions from being thrown when a form is serialized via an Ajax callback and/or form build.

Overrides ContainerFactoryPluginInterface::create

7 calls to WebformHandlerBase::create()
ActionWebformHandler::create in src/Plugin/WebformHandler/ActionWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
DebugWebformHandler::create in src/Plugin/WebformHandler/DebugWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
EmailWebformHandler::create in src/Plugin/WebformHandler/EmailWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
ExampleWebformHandler::create in modules/webform_example_handler/src/Plugin/WebformHandler/ExampleWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
OptionsLimitWebformHandler::create in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…

... See full list

8 methods override WebformHandlerBase::create()
ActionWebformHandler::create in src/Plugin/WebformHandler/ActionWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
DebugWebformHandler::create in src/Plugin/WebformHandler/DebugWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
EmailWebformHandler::create in src/Plugin/WebformHandler/EmailWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
ExampleWebformHandler::create in modules/webform_example_handler/src/Plugin/WebformHandler/ExampleWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…
OptionsLimitWebformHandler::create in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database…

... See full list

File

src/Plugin/WebformHandlerBase.php, line 141

Class

WebformHandlerBase
Provides a base class for a webform handler.

Namespace

Drupal\webform\Plugin

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  $instance = new static($configuration, $plugin_id, $plugin_definition);
  $instance->loggerFactory = $container
    ->get('logger.factory');
  $instance->configFactory = $container
    ->get('config.factory');
  $instance->renderer = $container
    ->get('renderer');
  $instance->entityTypeManager = $container
    ->get('entity_type.manager');
  $instance->conditionsValidator = $container
    ->get('webform_submission.conditions_validator');
  $instance->tokenManager = $container
    ->get('webform.token_manager');
  $instance
    ->setConfiguration($configuration);
  return $instance;
}