class PrimaryKey

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Database/SchemaDefinition/PrimaryKey.php \Drupal\Core\Database\SchemaDefinition\PrimaryKey

Describes a table's primary key.

Hierarchy

Expanded class hierarchy of PrimaryKey

13 files declare their use of PrimaryKey
BatchStorage.php in core/lib/Drupal/Core/Batch/BatchStorage.php
comment.install in core/modules/comment/comment.install
Install, update and uninstall functions for the Comment module.
database.api.php in core/lib/Drupal/Core/Database/database.api.php
Hooks related to the Database system and the Schema API.
dblog.install in core/modules/dblog/dblog.install
Install, update and uninstall functions for the dblog module.
DriverSpecificSchemaTestBase.php in core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php

... See full list

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.