You are here

protected function WebformSubmissionDevelGenerateTrait::initializeGenerate in Webform 8.5

Same name and namespace in other branches
  1. 6.x 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 339

Class

WebformSubmissionDevelGenerateTrait
Provides a WebformSubmissionDevelGenerate trait.

Namespace

Drupal\webform\Plugin\DevelGenerate

Code

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' => '',
  ];
}