public function ProcessForm::submitForm in Module Builder 8.3
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
1 method overrides ProcessForm::submitForm()
- ProcessTestSamplesForm::submitForm in module_builder_devel/
src/ Form/ ProcessTestSamplesForm.php - Form submission handler.
File
- src/
Form/ ProcessForm.php, line 169
Class
- ProcessForm
- Form for running the DCB analysis process.
Namespace
Drupal\module_builder\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Safe to do this without exception handling: it's already been checked in
// the form builder.
$task_handler_collect = static::getCollectTask();
$job_list = $task_handler_collect
->getJobList();
$batch = array(
'title' => t('Analysing site code'),
'operations' => array(),
'file' => drupal_get_path('module', 'module_builder') . '/includes/module_builder.admin.inc',
'finished' => [
get_class($this),
'batchFinished',
],
);
// Split the jobs into batches of 10.
$job_batches = array_chunk($job_list, 10);
foreach ($job_batches as $job_batch) {
// Run all jobs directly, without batch API. Also need to comment out
// the call to batch_set()! Useful for seeing debug output.
// $fake = [];
// $task_handler_collect->collectComponentDataIncremental($job_batch, $fake);
$batch['operations'][] = [
[
get_class($this),
'batchOperation',
],
[
$job_batch,
],
];
}
batch_set($batch);
}