You are here

nopremium.install in Node Option Premium 8

Same filename and directory in other branches
  1. 6 nopremium.install
  2. 7 nopremium.install

Install, update and uninstall functions for the nopremium module.

File

nopremium.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the nopremium module.
 */

/**
 * Implements hook_uninstall().
 */
function nopremium_uninstall() {

  /** @var \Drupal\Core\Config\StorageInterface $config_storage */
  $config_storage = \Drupal::service('config.storage');

  // Get a list of all content types.
  $node_types = \Drupal::entityTypeManager()
    ->getStorage('node_type')
    ->loadMultiple();

  // Delete premium config for each content type.
  foreach ($node_types as $node_type) {
    $config_storage
      ->delete('core.base_field_override.node.' . $node_type
      ->id() . '.premium');
  }
}

Functions

Namesort descending Description
nopremium_uninstall Implements hook_uninstall().