You are here

contact_form_revisions.install in Config Entity Revisions 8.2

Install hooks for contact_form_revisions.

File

modules/contact_form_revisions/contact_form_revisions.install
View source
<?php

/**
 * @file
 * Install hooks for contact_form_revisions.
 */

/**
 * Implements hook_install().
 */
function contact_form_revisions_install() {
  $entityTypeManager = \Drupal::entityTypeManager();
  $cert_storage = $entityTypeManager
    ->getStorage('config_entity_revisions_type');
  $entity = $cert_storage
    ->create([
    'id' => 'contact_form_revisions',
    'label' => 'Contact Form Revisions',
  ]);
  $entity
    ->save();
}

/**
 * Implements hook_uninstall().
 */
function contact_form_revisions_uninstall() {
  $entityTypeManager = \Drupal::entityTypeManager();
  $cert_storage = $entityTypeManager
    ->getStorage('config_entity_revisions_type');
  $entity = $cert_storage
    ->load('contact_form_revisions');
  $cert_storage
    ->delete([
    $entity,
  ]);
}

/**
 * Implements hook_update().
 */
function contact_form_revisions_8000(&$sandbox) {
  $entityTypeManager = \Drupal::entityTypeManager();
  $cert_storage = $entityTypeManager
    ->getStorage('config_entity_revisions_type');
  $entity = $cert_storage
    ->create([
    'id' => 'contact_form_revisions',
  ]);
  $entity
    ->save();
}

Functions