class KeyColumn

Describes a column of a database index or key.

Hierarchy

Expanded class hierarchy of KeyColumn

1 file declares its use of KeyColumn
SchemaDefinitionConversionTest.php in core/tests/Drupal/Tests/Core/Database/SchemaDefinitionConversionTest.php

File

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

Namespace

Drupal\Core\Database\SchemaDefinition
View source
final class KeyColumn implements SchemaDefinitionInterface {
  
  /**
   * Constructor.
   *
   * @param string $name
   *   The column name.
   * @param int|null $length
   *   (Optional) if set, specifies a prefix of the named column.
   */
  public function __construct(public readonly string $name, public readonly ?int $length = NULL) {
  }
  
  /**
   * The key column cannot be converted to an array.
   *
   * @throws \LogicException
   */
  public function toArray() : array {
    throw new \LogicException(__METHOD__ . ' is not implemented');
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
KeyColumn::toArray public function The key column cannot be converted to an array. Overrides SchemaDefinitionInterface::toArray
KeyColumn::__construct public function Constructor.

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