You are here

appointment_calendar.install in Appointment Calendar 8

Same filename and directory in other branches
  1. 7 appointment_calendar.install

Install and uninstall functions for the Appointment Calendar module.

File

appointment_calendar.install
View source
<?php

/**
 * @file
 * Install and uninstall functions for the Appointment Calendar module.
 */

/**
 * Implements hook_unistall().
 */
function appointment_calendar_uninstall() {
  $content_type = \Drupal::entityTypeManager()
    ->getStorage('node_type')
    ->load('appointment_calendar');
  $content_type
    ->delete();
}

/**
 * Implements hook_schema().
 */
function appointment_calendar_schema() {
  $schema['appointment_date'] = [
    'description' => 'The base table for Appointment Calendar Dates.',
    'fields' => [
      'date' => [
        'description' => 'Appointment Date',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
      'no_slots' => [
        'description' => 'No of Time Slots for particular Day.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
      'slot_values' => [
        'description' => 'Time Slots values for particular Day.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ],
      'slot_capacity' => [
        'description' => 'Time Slots Capacity for particular Day.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ],
    ],
  ];
  $schema['appointment_slots'] = [
    'description' => 'The base table for Appointment Calendar Slots.',
    'fields' => [
      'date' => [
        'description' => 'Appointment Date',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
      'slot' => [
        'description' => 'Time Slots for particular Day.',
        'type' => 'varchar',
        'length' => 60,
      ],
      'nid' => [
        'description' => 'Node ID.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
      'uid' => [
        'description' => 'User ID.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
  ];
  return $schema;
}

Functions

Namesort descending Description
appointment_calendar_schema Implements hook_schema().
appointment_calendar_uninstall Implements hook_unistall().