forked from acquia-pso/dst-entity-generate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dst_entity_generate.install
36 lines (31 loc) · 962 Bytes
/
dst_entity_generate.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
29
30
31
32
33
34
35
36
<?php
/**
* @file
* Module install file.
*/
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Url;
/**
* @file
* Contains the implementations for the DST Entity Generate install.
*/
/**
* Implements hook_install().
*/
function dst_entity_generate_install() {
if (!InstallerKernel::installationAttempted()) {
$google_sheet_api_settings_url = Url::fromRoute('dst_entity_generate.google_sheet_api_settings')->toString();
$message = t('Configure <a href="@google_sheet_api_settings_url">Google Sheet API</a> to start with entity generation.',
['@google_sheet_api_settings_url' => $google_sheet_api_settings_url]
);
\Drupal::messenger()->addMessage($message);
}
}
/**
* Implements hook_uninstall().
*/
function dst_entity_generate_uninstall() {
// Delete key value stores on uninstall.
\Drupal::keyValue('dst_google_sheet_storage')->deleteAll();
\Drupal::keyValue('dst_entity_generate_storage')->deleteAll();
}