protected function 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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Routing!MatcherDumper.php/function/MatcherDumper::schemaDefinition/8.1.x