You are here

mentions.install in Open Social 8.3

Install, update and uninstall functions for the mentions module.

File

modules/custom/mentions/mentions.install
View source
<?php

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

/**
 * Implements hook_install().
 *
 * Perform actions related to the installation of mentions.
 */
function mentions_install() {

  // Set default configurations.
  _mentions_set_default_config();
}

/**
 * Set default settings.
 */
function _mentions_set_default_config() {
  $config = \Drupal::configFactory()
    ->getEditable('mentions.settings');
  $supported_entity_types = [
    'node',
    'comment',
    'taxonomy_term',
    'user',
  ];
  $supported_entity_types = array_combine($supported_entity_types, $supported_entity_types);
  $config
    ->set('supported_entity_types', $supported_entity_types);
  $config
    ->save();
}

/**
 * Implements hook_uninstall().
 */
function mentions_uninstall() {
  \Drupal::service('config.factory')
    ->getEditable('mentions.settings')
    ->delete();
}

Functions

Namesort descending Description
mentions_install Implements hook_install().
mentions_uninstall Implements hook_uninstall().
_mentions_set_default_config Set default settings.