class PrimaryKey

Describes a table's primary key.

Hierarchy

Expanded class hierarchy of PrimaryKey

5 files declare their use of PrimaryKey
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
SchemaDefinitionTest.php in core/tests/Drupal/Tests/Core/Database/SchemaDefinitionTest.php

File

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

Namespace

Drupal\Core\Database\SchemaDefinition
View source
final class PrimaryKey extends KeyBase {
  
  /**
   * Constructor.
   *
   * @param list<KeyColumn|string> $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(array $columns) {
    parent::__construct($columns, FALSE);
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
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
PrimaryKey::__construct public function Constructor. Overrides KeyBase::__construct

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