You are here

public function SqlContentEntityStorage::getCustomTableMapping in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::getCustomTableMapping()
  2. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::getCustomTableMapping()

Gets a table mapping for the specified entity type and storage definitions.

@internal

Parameters

\Drupal\Core\Entity\ContentEntityTypeInterface $entity_type: An entity type definition.

\Drupal\Core\Field\FieldStorageDefinitionInterface[] $storage_definitions: An array of field storage definitions to be used to compute the table mapping.

string $prefix: (optional) A prefix to be used by all the tables of this mapping. Defaults to an empty string.

Return value

\Drupal\Core\Entity\Sql\TableMappingInterface A table mapping object for the entity's tables.

1 call to SqlContentEntityStorage::getCustomTableMapping()
SqlContentEntityStorage::getTableMapping in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
Gets a table mapping for the entity's SQL tables.

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 379

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

public function getCustomTableMapping(ContentEntityTypeInterface $entity_type, array $storage_definitions, $prefix = '') {
  $prefix = $prefix ?: ($this->temporary ? 'tmp_' : '');
  return DefaultTableMapping::create($entity_type, $storage_definitions, $prefix);
}