mentions.install in Open Social 8.2
Same filename and directory in other branches
- 8.9 modules/custom/mentions/mentions.install
- 8 modules/custom/mentions/mentions.install
- 8.3 modules/custom/mentions/mentions.install
- 8.4 modules/custom/mentions/mentions.install
- 8.5 modules/custom/mentions/mentions.install
- 8.6 modules/custom/mentions/mentions.install
- 8.7 modules/custom/mentions/mentions.install
- 8.8 modules/custom/mentions/mentions.install
- 10.3.x modules/custom/mentions/mentions.install
- 10.0.x modules/custom/mentions/mentions.install
- 10.1.x modules/custom/mentions/mentions.install
- 10.2.x modules/custom/mentions/mentions.install
Install, update and uninstall functions for the mentions module.
File
modules/custom/mentions/mentions.installView 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
Name | Description |
---|---|
mentions_install | Implements hook_install(). |
mentions_uninstall | Implements hook_uninstall(). |
_mentions_set_default_config | Set default settings. |