MatcherDumper::schemaDefinition

protected MatcherDumper::schemaDefinition()

Defines the schema for the router table.

Return value

array The schema API definition for the SQL storage table.

File

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

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;
}
doc_Drupal
2016-10-29 09:25:39
Comments
Leave a Comment

Please login to continue.