function MatcherDumper::schemaDefinition

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Routing/MatcherDumper.php \Drupal\Core\Routing\MatcherDumper::schemaDefinition()
  2. 10 core/lib/Drupal/Core/Routing/MatcherDumper.php \Drupal\Core\Routing\MatcherDumper::schemaDefinition()
  3. 11.x core/lib/Drupal/Core/Routing/MatcherDumper.php \Drupal\Core\Routing\MatcherDumper::schemaDefinition()

Defines the schema for the router table.

@internal

Return value

array The schema API definition for the SQL storage table.

1 call to MatcherDumper::schemaDefinition()
MatcherDumper::ensureTableExists in core/lib/Drupal/Core/Routing/MatcherDumper.php
Checks if the tree table exists and create it if not.

File

core/lib/Drupal/Core/Routing/MatcherDumper.php, line 206

Class

MatcherDumper
Dumps Route information to a database table.

Namespace

Drupal\Core\Routing

Code

protected function schemaDefinition() {
    $schema = [
        'description' => 'Maps paths to various callbacks (access, page and title)',
        'fields' => [
            'name' => [
                'description' => 'Primary Key: Machine name of this route',
                'type' => 'varchar_ascii',
                'length' => 255,
                'not null' => TRUE,
                'default' => '',
            ],
            'path' => [
                'description' => 'The path for this URI',
                'type' => 'varchar',
                'length' => 255,
                'not null' => TRUE,
                'default' => '',
            ],
            'pattern_outline' => [
                'description' => 'The pattern',
                'type' => 'varchar',
                'length' => 255,
                'not null' => TRUE,
                'default' => '',
            ],
            'fit' => [
                'description' => 'A numeric representation of how specific the path is.',
                'type' => 'int',
                'not null' => TRUE,
                'default' => 0,
            ],
            'route' => [
                'description' => 'A serialized Route object',
                'type' => 'blob',
                'size' => 'big',
            ],
            'number_parts' => [
                'description' => 'Number of parts in this router path.',
                'type' => 'int',
                'not null' => TRUE,
                'default' => 0,
                'size' => 'small',
            ],
        ],
        'indexes' => [
            'pattern_outline_parts' => [
                'pattern_outline',
                'number_parts',
            ],
        ],
        'primary key' => [
            'name',
        ],
    ];
    return $schema;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.