You are here

public function WebformSubmissionGenerate::__construct in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionGenerate.php \Drupal\webform\WebformSubmissionGenerate::__construct()

Constructs a WebformSubmissionGenerate object.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration object factory.

\Drupal\webform\WebformTokenManagerInterface $token_manager: The webform token manager.

\Drupal\webform\Plugin\WebformElementManagerInterface $element_manager: The webform element manager.

File

src/WebformSubmissionGenerate.php, line 63

Class

WebformSubmissionGenerate
Webform submission generator.

Namespace

Drupal\webform

Code

public function __construct(ConfigFactoryInterface $config_factory, WebformTokenManagerInterface $token_manager, WebformElementManagerInterface $element_manager) {
  $this->configFactory = $config_factory;
  $this->tokenManager = $token_manager;
  $this->elementManager = $element_manager;
  $this->types = Yaml::decode($this->configFactory
    ->get('webform.settings')
    ->get('test.types') ?: '') ?: [];
  $this->names = Yaml::decode($this->configFactory
    ->get('webform.settings')
    ->get('test.names') ?: '') ?: [];
}