5 * Install, update and uninstall functions for the {{ name }} module.
9 * Implements hook_install().
11 function {{ machine_name }}_install() {
12 drupal_set_message(__FUNCTION__);
16 * Implements hook_uninstall().
18 function {{ machine_name }}_uninstall() {
19 drupal_set_message(__FUNCTION__);
23 * Implements hook_schema().
25 function {{ machine_name }}_schema() {
26 $schema['{{ machine_name }}_example'] = [
27 'description' => 'Table description.',
32 'description' => 'Primary Key: Unique record ID.',
39 'description' => 'The {users}.uid of the user who created the record.',
42 'description' => 'Boolean indicating whether this record is active.',
50 'type' => 'varchar_ascii',
54 'description' => 'Type of the record.',
60 'description' => 'Timestamp when the record was created.',
66 'description' => 'The arbitrary data for the item.',
69 'primary key' => ['id'],
73 'status' => ['status'],
81 * Implements hook_requirements().
83 function {{ machine_name }}_requirements($phase) {
86 if ($phase == 'runtime') {
87 $value = mt_rand(0, 100);
88 $requirements['{{ machine_name }}_status'] = [
89 'title' => t('{{ name }} status'),
90 'value' => t('{{ name }} value: @value', ['@value' => $value]),
91 'severity' => $value > 50 ? REQUIREMENT_INFO : REQUIREMENT_WARNING,