You are here

node_authlink.install in Node authorize link 8

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

File

node_authlink.install
View source
<?php

/**
 * Implementation of hook_schema().
 */
function node_authlink_schema() {
  $schema['node_authlink_nodes'] = [
    'description' => 'Table for store authorization keys.',
    'fields' => [
      'nid' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'authkey' => [
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ],
      'created' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'primary key' => [
      'nid',
    ],
  ];
  return $schema;
}

/**
 * Inplementation of hook_install().
 */
function node_authlink_install() {
  $messenger = \Drupal::messenger();
  if (isset($message)) {
    $messenger
      ->addStatus(t('To setup Node authorize link module go to Structure → Content types → edit → Node authorize link.'));
  }
}

Functions

Namesort descending Description
node_authlink_install Inplementation of hook_install().
node_authlink_schema Implementation of hook_schema().