You are here

domain_alias.install in Domain Access 8

Install, update and uninstall functions for the Domain Alias module.

File

domain_alias/domain_alias.install
View source
<?php

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

/**
 * Sets the default set of environments.
 */
function domain_alias_set_environments() {
  $config = \Drupal::service('config.factory')
    ->getEditable('domain_alias.settings');

  // Set and save new message value.
  $environments = [
    'default',
    'local',
    'development',
    'staging',
    'testing',
  ];
  $config
    ->set('environments', $environments)
    ->save();
}

/**
 * Updates domain_alias schema.
 */
function domain_alias_update_8001() {
  $manager = \Drupal::entityDefinitionUpdateManager();

  // Regenerate entity type indexes.
  $manager
    ->updateEntityType($manager
    ->getEntityType('domain_alias'));
}

/**
 * Adds domain_alias environment settings.
 */
function domain_alias_update_8002() {

  // Set the default environments variable.
  domain_alias_set_environments();
}

Functions

Namesort descending Description
domain_alias_set_environments Sets the default set of environments.
domain_alias_update_8001 Updates domain_alias schema.
domain_alias_update_8002 Adds domain_alias environment settings.