You are here

public static function WebformRevisionsController::submission_presave in Config Entity Revisions 8

Same name and namespace in other branches
  1. 1.x modules/webform_revisions/src/Controller/WebformRevisionsController.php \Drupal\webform_revisions\Controller\WebformRevisionsController::submission_presave()

@Implements hook_webform_submission_presave().

File

modules/webform_revisions/src/Controller/WebformRevisionsController.php, line 61

Class

WebformRevisionsController
Controller to make library functions available to various consumers.

Namespace

Drupal\webform_revisions\Controller

Code

public static function submission_presave(WebformSubmissionInterface $webform_submission) {
  $match = \Drupal::service('router')
    ->matchRequest(\Drupal::request());
  $webform_id = $match['webform'];
  $config_entity = \Drupal::entityTypeManager()
    ->getStorage('webform')
    ->load($webform_id);
  $revisionsEntity = $config_entity
    ->contentEntityStorage()
    ->loadRevision($config_entity
    ->getRevisionID());
}