You are here

function webform_test_message_custom_webform_message_custom in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/modules/webform_test_message_custom/webform_test_message_custom.module \webform_test_message_custom_webform_message_custom()

Implements hook_webform_message_custom().

File

tests/modules/webform_test_message_custom/webform_test_message_custom.module, line 11
Support module for Webform module custom message testing.

Code

function webform_test_message_custom_webform_message_custom($operation, $id) {

  // Handle 'webform_test_message_custom' defined in
  // webform.webform.test_element_message.yml.
  if ($id === 'webform_test_message_custom') {
    switch ($operation) {
      case 'closed':
        return \Drupal::state()
          ->get($id, FALSE);
      case 'close':
        \Drupal::state()
          ->set($id, TRUE);
        return NULL;
      case 'reset':
        \Drupal::state()
          ->delete($id);
        return NULL;
    }
  }
}