You are here

function webform_content_creator_webform_submission_delete in Webform Content Creator 3.x

Same name and namespace in other branches
  1. 8 webform_content_creator.module \webform_content_creator_webform_submission_delete()
  2. 2.x webform_content_creator.module \webform_content_creator_webform_submission_delete()

Implements hook_webform_submission_delete().

File

./webform_content_creator.module, line 57
Allows to call functions after creating/editing/deleting webform submissions.

Code

function webform_content_creator_webform_submission_delete($webform_submission) {
  $entities = \Drupal::entityTypeManager()
    ->getStorage('webform_content_creator')
    ->loadMultiple();
  foreach ($entities as $e) {
    if (!$e
      ->equalsWebform($webform_submission
      ->bundle()) || !$e
      ->existsContentType()) {
      continue;
    }
    $e
      ->updateNode($webform_submission, 'delete');
  }
}