public function WebformSubmissionsDeleteFormBase::batchSet in Webform 8.5
Same name and namespace in other branches
- 6.x src/Form/WebformSubmissionsDeleteFormBase.php \Drupal\webform\Form\WebformSubmissionsDeleteFormBase::batchSet()
Batch API; Initialize batch operations.
Parameters
\Drupal\webform\WebformInterface|null $webform: The webform.
\Drupal\Core\Entity\EntityInterface|null $entity: The webform's source entity.
1 call to WebformSubmissionsDeleteFormBase::batchSet()
- WebformSubmissionsDeleteFormBase::submitForm in src/
Form/ WebformSubmissionsDeleteFormBase.php - Form submission handler.
File
- src/
Form/ WebformSubmissionsDeleteFormBase.php, line 153
Class
- WebformSubmissionsDeleteFormBase
- Base webform for deleting webform submission.
Namespace
Drupal\webform\FormCode
public function batchSet(WebformInterface $webform = NULL, EntityInterface $entity = NULL) {
$parameters = [
$webform,
$entity,
$this->submissionStorage
->getMaxSubmissionId($webform, $entity),
];
$batch = [
'title' => $this
->t('Clear submissions'),
'init_message' => $this
->t('Clearing submission data'),
'error_message' => $this
->t('The submissions could not be cleared because an error occurred.'),
'operations' => [
[
[
$this,
'batchProcess',
],
$parameters,
],
],
'finished' => [
$this,
'batchFinish',
],
];
batch_set($batch);
}