class Index

Describes a database index.

Hierarchy

Expanded class hierarchy of Index

4 files declare their use of Index
BatchStorage.php in core/lib/Drupal/Core/Batch/BatchStorage.php
database.api.php in core/lib/Drupal/Core/Database/database.api.php
Hooks related to the Database system and the Schema API.
locale.install in core/modules/locale/locale.install
Install, update, and uninstall functions for the Locale module.
SchemaDefinitionConversionTest.php in core/tests/Drupal/Tests/Core/Database/SchemaDefinitionConversionTest.php
8 string references to 'Index'
CachePluginBase::getRowId in core/modules/views/src/Plugin/views/cache/CachePluginBase.php
Returns a unique identifier for the specified row.
DriverSpecificSchemaTestBase::testReservedKeywordsForNaming in core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php
Tests handling with reserved keywords for naming tables, fields and more.
field.schema.yml in core/modules/field/config/schema/field.schema.yml
core/modules/field/config/schema/field.schema.yml
SchemaIntrospectionTestTrait::getIndexColumnNames in core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php
Returns the column names used by the indexes of a table.
SchemaTest::testReservedKeywordsForNaming in core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
Tests handling with reserved keywords for naming tables, fields and more.

... See full list

File

core/lib/Drupal/Core/Database/SchemaDefinition/Index.php, line 10

Namespace

Drupal\Core\Database\SchemaDefinition
View source
final class Index extends KeyBase {
  
  /**
   * Constructor.
   *
   * @param string $name
   *   The index name.
   * @param list<KeyColumn|string|array{0:string, 1:int}> $columns
   *   A mix of key column specifiers, being KeyColumn objects, strings naming
   *   columns, or arrays of two elements, column name and length, specifying a
   *   prefix of the named column.
   */
  public function __construct(public readonly string $name, array $columns) {
    parent::__construct($columns, TRUE);
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Index::__construct public function Constructor. Overrides KeyBase::__construct
KeyBase::$columns public property The key columns.
KeyBase::buildKeyColumns protected function Builds an array of KeyColumn objects from a mixed list of columns.
KeyBase::toArray public function Converts the object to legacy array-based specifications. Overrides SchemaDefinitionInterface::toArray 1

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