You are here

public function DefaultTableMapping::getDedicatedTableNames 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::getDedicatedTableNames()

Gets a list of dedicated table names for this mapping.

Return value

string[] An array of table names.

File

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

Class

DefaultTableMapping
Defines a default table mapping class.

Namespace

Drupal\Core\Entity\Sql

Code

public function getDedicatedTableNames() {
  $table_mapping = $this;
  $definitions = array_filter($this->fieldStorageDefinitions, function ($definition) use ($table_mapping) {
    return $table_mapping
      ->requiresDedicatedTableStorage($definition);
  });
  $data_tables = array_map(function ($definition) use ($table_mapping) {
    return $table_mapping
      ->getDedicatedDataTableName($definition);
  }, $definitions);
  $revision_tables = array_map(function ($definition) use ($table_mapping) {
    return $table_mapping
      ->getDedicatedRevisionTableName($definition);
  }, $definitions);
  $dedicated_tables = array_merge(array_values($data_tables), array_values($revision_tables));
  return $dedicated_tables;
}