diff --git a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php index b701279..46c1130 100644 --- a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php +++ b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php @@ -217,14 +217,7 @@ public function getFieldColumnName(FieldStorageDefinitionInterface $storage_defi } /** - * Adds field columns for a table to the table mapping. - * - * @param string $table_name - * The name of the table to add the field column for. - * @param string[] $field_names - * A list of field names to add the columns for. - * - * @return $this + * {@inheritdoc} */ public function setFieldNames($table_name, array $field_names) { $this->fieldNames[$table_name] = $field_names; @@ -244,14 +237,7 @@ public function getExtraColumns($table_name) { } /** - * Adds a extra columns for a table to the table mapping. - * - * @param string $table_name - * The name of table to add the extra columns for. - * @param string[] $column_names - * The list of column names. - * - * @return $this + * {@inheritdoc} */ public function setExtraColumns($table_name, array $column_names) { $this->extraColumns[$table_name] = $column_names; @@ -261,36 +247,21 @@ public function setExtraColumns($table_name, array $column_names) { } /** - * Checks whether the given field can be stored in a shared table. - * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition - * The field storage definition. - * - * @return bool - * TRUE if the field can be stored in a dedicated table, FALSE otherwise. + * {@inheritdoc} */ public function allowsSharedTableStorage(FieldStorageDefinitionInterface $storage_definition) { return !$storage_definition->hasCustomStorage() && $storage_definition->isBaseField() && !$storage_definition->isMultiple(); } /** - * Checks whether the given field has to be stored in a dedicated table. - * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition - * The field storage definition. - * - * @return bool - * TRUE if the field can be stored in a dedicated table, FALSE otherwise. + * {@inheritdoc} */ public function requiresDedicatedTableStorage(FieldStorageDefinitionInterface $storage_definition) { return !$storage_definition->hasCustomStorage() && !$this->allowsSharedTableStorage($storage_definition); } /** - * Gets a list of dedicated table names for this mapping. - * - * @return string[] - * An array of table names. + * {@inheritdoc} */ public function getDedicatedTableNames() { $table_mapping = $this; @@ -309,16 +280,7 @@ public function getReservedColumns() { } /** - * Generates a table name for a field data table. - * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition - * The field storage definition. - * @param bool $is_deleted - * (optional) Whether the table name holding the values of a deleted field - * should be returned. - * - * @return string - * A string containing the generated name for the database table. + * {@inheritdoc} */ public function getDedicatedDataTableName(FieldStorageDefinitionInterface $storage_definition, $is_deleted = FALSE) { if ($is_deleted) { @@ -335,16 +297,7 @@ public function getDedicatedDataTableName(FieldStorageDefinitionInterface $stora } /** - * Generates a table name for a field revision archive table. - * - * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition - * The field storage definition. - * @param bool $is_deleted - * (optional) Whether the table name holding the values of a deleted field - * should be returned. - * - * @return string - * A string containing the generated name for the database table. + * {@inheritdoc} */ public function getDedicatedRevisionTableName(FieldStorageDefinitionInterface $storage_definition, $is_deleted = FALSE) { if ($is_deleted) { diff --git a/core/lib/Drupal/Core/Entity/Sql/TableMappingInterface.php b/core/lib/Drupal/Core/Entity/Sql/TableMappingInterface.php index 9d555a1..7a372fe 100644 --- a/core/lib/Drupal/Core/Entity/Sql/TableMappingInterface.php +++ b/core/lib/Drupal/Core/Entity/Sql/TableMappingInterface.php @@ -115,5 +115,86 @@ public function getFieldColumnName(FieldStorageDefinitionInterface $storage_defi * @throws \Drupal\Core\Entity\Sql\SqlContentEntityStorageException */ public function getFieldTableName($field_name); - + + /** + * Adds field columns for a table to the table mapping. + * + * @param string $table_name + * The name of the table to add the field column for. + * @param string[] $field_names + * A list of field names to add the columns for. + * + * @return $this + */ + public function setFieldNames($table_name, array $field_names); + + /** + * Adds a extra columns for a table to the table mapping. + * + * @param string $table_name + * The name of table to add the extra columns for. + * @param string[] $column_names + * The list of column names. + * + * @return $this + */ + public function setExtraColumns($table_name, array $column_names); + + /** + * Checks whether the given field can be stored in a shared table. + * + * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition + * The field storage definition. + * + * @return bool + * TRUE if the field can be stored in a dedicated table, FALSE otherwise. + */ + public function allowsSharedTableStorage(FieldStorageDefinitionInterface $storage_definition); + + /** + * Checks whether the given field has to be stored in a dedicated table. + * + * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition + * The field storage definition. + * + * @return bool + * TRUE if the field can be stored in a dedicated table, FALSE otherwise. + */ + public function requiresDedicatedTableStorage(FieldStorageDefinitionInterface $storage_definition); + + /** + * Gets a list of dedicated table names for this mapping. + * + * @return string[] + * An array of table names. + */ + public function getDedicatedTableNames(); + + /** + * Generates a table name for a field data table. + * + * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition + * The field storage definition. + * @param bool $is_deleted + * (optional) Whether the table name holding the values of a deleted field + * should be returned. + * + * @return string + * A string containing the generated name for the database table. + */ + public function getDedicatedDataTableName(FieldStorageDefinitionInterface $storage_definition, $is_deleted = FALSE); + + /** + * Generates a table name for a field revision archive table. + * + * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition + * The field storage definition. + * @param bool $is_deleted + * (optional) Whether the table name holding the values of a deleted field + * should be returned. + * + * @return string + * A string containing the generated name for the database table. + */ + public function getDedicatedRevisionTableName(FieldStorageDefinitionInterface $storage_definition, $is_deleted = FALSE); }