public function WebformCliService::drush_webform_generate in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Commands/WebformCliService.php \Drupal\webform\Commands\WebformCliService::drush_webform_generate()
Implements drush_hook_COMMAND().
Overrides WebformCliServiceInterface::drush_webform_generate
File
- src/
Commands/ WebformCliService.php, line 653
Class
- WebformCliService
- Drush version agnostic commands.
Namespace
Drupal\webform\CommandsCode
public function drush_webform_generate($webform_id = NULL, $num = NULL) {
$values = [
'webform_ids' => [
$webform_id => $webform_id,
],
'num' => $num ?: 50,
'feedback' => $this
->drush_get_option('feedback') ?: 1000,
'kill' => $this
->drush_get_option('kill'),
'entity-type' => $this
->drush_get_option('entity-type'),
'entity-id' => $this
->drush_get_option('entity-id'),
];
/** @var \Drupal\webform\Plugin\DevelGenerate\WebformSubmissionDevelGenerate $instance */
$instance = \Drupal::service('plugin.manager.develgenerate')
->createInstance('webform_submission', []);
$instance
->generate($values);
}