protected function WebformSubmissionDevelGenerateTrait::initializeGenerate in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php \Drupal\webform\Plugin\DevelGenerate\WebformSubmissionDevelGenerateTrait::initializeGenerate()
Add 'users' that contains a list of uids.
Parameters
array $values: The element values from the settings webform.
1 call to WebformSubmissionDevelGenerateTrait::initializeGenerate()
- WebformSubmissionDevelGenerateTrait::generateSubmissions in src/
Plugin/ DevelGenerate/ WebformSubmissionDevelGenerateTrait.php - Generates submissions for a list of given webforms.
File
- src/
Plugin/ DevelGenerate/ WebformSubmissionDevelGenerateTrait.php, line 280
Class
- WebformSubmissionDevelGenerateTrait
- Provides a WebformSubmissionDevelGenerate plugin.
Namespace
Drupal\webform\Plugin\DevelGenerateCode
protected function initializeGenerate(array &$values) {
// Set user id.$devel_generate_manager = \Drupal::service('plugin.manager.develgenerate')
$users = $this
->getUsers();
$users = array_merge($users, [
'0',
]);
$values['users'] = $users;
// Set created min and max.
$values['created_min'] = strtotime('-1 month');
$values['created_max'] = $this->time
->getRequestTime();
// Set entity type and id default value.
$values += [
'num' => 50,
'entity-type' => '',
'entity-id' => '',
];
}