views_url_alias.install in Views URL alias 8.2
Installation information for the Views URL alias module.
File
views_url_alias.installView source
<?php
/**
* @file
* Installation information for the Views URL alias module.
*/
use Drupal\Core\Entity\EntityTypeInterface;
/**
* Implements hook_install().
*/
function views_url_alias_install() {
// Set the weight to 2 so that this module executes after pathauto.
module_set_weight('views_url_alias', 2);
module_load_include('module', 'views_url_alias');
views_url_alias_rebuild();
}
/**
* Implements hook_schema().
*/
function views_url_alias_schema() {
return [
'views_url_alias' => [
'description' => t("A second url alias table for only content alias."),
'fields' => [
'entity_type' => [
'type' => 'varchar_ascii',
'not null' => TRUE,
'default' => 'node',
'length' => EntityTypeInterface::ID_MAX_LENGTH,
'description' => 'The entity_type of the entity to which this comment is a reply.',
],
'entity_id' => [
'description' => 'The related entity_id for the url alias.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
'langcode' => [
'description' => "The language code this alias is for; if 'und', the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.",
'type' => 'varchar_ascii',
'length' => 12,
'not null' => TRUE,
'default' => '',
],
'alias' => [
'description' => 'The alias for this path; e.g. title-of-the-story.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
],
],
'index' => [
'entiy_id_entity_type_langcode' => [
'entity_type',
'entity_id',
'langcode',
],
],
],
];
}
Functions
Name![]() |
Description |
---|---|
views_url_alias_install | Implements hook_install(). |
views_url_alias_schema | Implements hook_schema(). |