-
Notifications
You must be signed in to change notification settings - Fork 0
/
shareaholic.install
28 lines (24 loc) · 990 Bytes
/
shareaholic.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* Implements hook_install().
*/
function shareaholic_install() {
/** @var \Drupal\Core\Config\Config $config */
$config = \Drupal::service('shareaholic.editable_config');
$currentVersion = system_get_info('module', 'shareaholic')['version'];
$config->set('module_version', $currentVersion)->save();
/** @var \Drupal\shareaholic\Api\EventLogger $eventLogger */
$eventLogger = \Drupal::service('shareaholic.api.event_logger');
$eventLogger->log($eventLogger::EVENT_INSTALL_FRESH);
}
/**
* Implements hook_uninstall().
*/
function shareaholic_uninstall() {
/** @var \Drupal\shareaholic\Helper\ShareaholicEntityManager $shareaholicEntityManager */
$shareaholicEntityManager = Drupal::service('shareaholic.entity_manager');
$shareaholicEntityManager->removeAllLocations();
/** @var \Drupal\shareaholic\Api\EventLogger $eventLogger */
$eventLogger = \Drupal::service('shareaholic.api.event_logger');
$eventLogger->log($eventLogger::EVENT_UNINSTALL);
}