You are here

function modal_page_update_40002 in Modal 8.3

Same name and namespace in other branches
  1. 5.0.x modal_page.install \modal_page_update_40002()
  2. 4.0.x modal_page.install \modal_page_update_40002()
  3. 4.1.x modal_page.install \modal_page_update_40002()

Created new field "Close Modal with ESC and Clicling Outside".

File

./modal_page.install, line 17
Install, update and uninstall functions for the Modal Page.

Code

function modal_page_update_40002() {
  $modalPageFieldHelper = new ModalPageFieldHelper();
  $closeModalEscKey = $modalPageFieldHelper
    ->getFieldCloseModalEscKey();
  $closeModalClickingOutside = $modalPageFieldHelper
    ->getFieldCloseClickingOutside();
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('close_modal_esc_key', 'modal_page_modal', 'modal_page_modal', $closeModalEscKey);
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('close_modal_clicking_outside', 'modal_page_modal', 'modal_page_modal', $closeModalClickingOutside);
  $field_close_esc_key = [
    'close_modal_esc_key' => 1,
  ];
  modal_page_update_modal_table($field_close_esc_key);
  $field_close_clicking_outside = [
    'close_modal_clicking_outside' => 1,
  ];
  modal_page_update_modal_table($field_close_clicking_outside);
  \Drupal::service('cache.render')
    ->invalidateAll();
}