File: /var/www/html/drupal/pagina46_zoom/pagina46_zoom.install
<?php
/**
* @file
* Install, update and uninstall functions for the pagina46_zoom module.
*/
/**
* Implements hook_install().
*/
function pagina46_zoom_install() {
\Drupal::messenger()->addStatus(__FUNCTION__);
}
/**
* Implements hook_uninstall().
*/
function pagina46_zoom_uninstall() {
\Drupal::messenger()->addStatus(__FUNCTION__);
}
/**
* Implements hook_schema().
*/
function pagina46_zoom_schema() {
$schema['pagina46_zoom_registrations'] = [
'description' => 'Tabella registrazioni.',
'fields' => [
'id' => [
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique record ID.',
],
'type' => [
'type' => 'varchar_ascii',
'length' => 5,
'not null' => TRUE,
'default' => '',
'description' => 'tipo di riunione meeting o webinar.',
],
'mail' => [
'type' => 'varchar_ascii',
'length' => 128,
'not null' => TRUE,
'default' => '',
'description' => 'Email dell utente registrato',
],
'zoom_id' => [
'type' => 'varchar_ascii',
'length' => 64,
'not null' => TRUE,
'default' => '',
],
'zoom_registration_id' => [
'type' => 'varchar_ascii',
'length' => 64,
'not null' => TRUE,
'default' => '',
]
],
'primary key' => ['id'],
'indexes' => [
'type' => ['mail'],
],
];
return $schema;
}
/**
* Implements hook_requirements().
*/
function pagina46_zoom_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
$value = mt_rand(0, 100);
$requirements['pagina46_zoom_status'] = [
'title' => t('pagina46_zoom status'),
'value' => t('pagina46_zoom value: @value', ['@value' => $value]),
'severity' => $value > 50 ? REQUIREMENT_INFO : REQUIREMENT_WARNING,
];
}
return $requirements;
}