You are here

public function DefaultTableMapping::setExtraColumns in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php \Drupal\Core\Entity\Sql\DefaultTableMapping::setExtraColumns()

Adds extra columns for a table to the table mapping.

@internal

@todo Make this method protected in drupal:9.0.0.

Parameters

string $table_name: The name of table to add the extra columns for.

string[] $column_names: The list of column names.

Return value

$this

See also

https://www.drupal.org/node/3067336

1 call to DefaultTableMapping::setExtraColumns()
TestDefaultTableMapping::setExtraColumns in core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
Adds extra columns for a table to the table mapping.
1 method overrides DefaultTableMapping::setExtraColumns()
TestDefaultTableMapping::setExtraColumns in core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
Adds extra columns for a table to the table mapping.

File

core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php, line 492

Class

DefaultTableMapping
Defines a default table mapping class.

Namespace

Drupal\Core\Entity\Sql

Code

public function setExtraColumns($table_name, array $column_names) {
  $this->extraColumns[$table_name] = $column_names;

  // Force the re-computation of the column list.
  unset($this->allColumns[$table_name]);
  return $this;
}