AliasStorage::schemaDefinition

public static AliasStorage::schemaDefinition()

Defines the schema for the {url_alias} table.

File

core/lib/Drupal/Core/Path/AliasStorage.php, line 410

Class

AliasStorage
Provides a class for CRUD operations on path aliases.

Namespace

Drupal\Core\Path

Code

public static function schemaDefinition() {
  return [
    'description' => 'A list of URL aliases for Drupal paths; a user may visit either the source or destination path.',
    'fields' => [
      'pid' => [
        'description' => 'A unique path alias identifier.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'source' => [
        'description' => 'The Drupal path this alias is for; e.g. node/12.',
        'type' => 'varchar',
        'length' => 255,
        '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' => '',
      ],
      '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' => '',
      ],
    ],
    'primary key' => ['pid'],
    'indexes' => [
      'alias_langcode_pid' => ['alias', 'langcode', 'pid'],
      'source_langcode_pid' => ['source', 'langcode', 'pid'],
    ],
  ];
}
doc_Drupal
2016-10-29 08:44:15
Comments
Leave a Comment

Please login to continue.