TestPurgeHandler.php in Webform 8.5
File
tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestPurgeHandler.php
View source
<?php
namespace Drupal\webform_test_handler\Plugin\WebformHandler;
use Drupal\webform\Plugin\WebformHandlerBase;
use Drupal\webform\WebformSubmissionInterface;
class TestPurgeHandler extends WebformHandlerBase {
public function prePurge(array $webform_submissions) {
\Drupal::state()
->set('webform_test_purge_handler_pre', array_map(function (WebformSubmissionInterface $submission) {
return $submission
->id();
}, $webform_submissions));
parent::prePurge($webform_submissions);
}
public function postPurge(array $webform_submissions) {
\Drupal::state()
->set('webform_test_purge_handler_post', array_map(function (WebformSubmissionInterface $submission) {
return $submission
->id();
}, $webform_submissions));
parent::postPurge($webform_submissions);
}
}