TableMappingInterface
interface TableMappingInterface (View source)
Provides a common interface for mapping field columns to SQL tables.
Warning: using methods provided here should be done only when writing code that is explicitly targeting a SQL-based entity storage. Typically this API is used by SQL storage classes, or other SQL-specific code like the Views integration code for the Entity SQL storage. Another example of legal usage of this API is when needing to write a query that \Drupal::entityQuery() does not support. Always retrieve entity identifiers and use them to load entities instead of accessing data stored in the database directly. Any other usage circumvents the entity system and is strongly discouraged, at least when writing contributed code.
Constants
| DELTA |
A property that represents delta used in entity query conditions. |
Methods
Gets a list of table names for this mapping.
Gets a list of all database columns for a given table.
Gets a list of names for entity fields stored in the specified table.
Gets a mapping of field columns to database columns for a given field.
Gets a list of extra database columns, which store denormalized data.
Gets the list of columns that can not be used as field type columns.
Generates a column name for a field property.
Gets the table name for a given column.
Details
string[]
getTableNames()
Gets a list of table names for this mapping.
string[]
getAllColumns(string $table_name)
Gets a list of all database columns for a given table.
string[]
getFieldNames(string $table_name)
Gets a list of names for entity fields stored in the specified table.
The return list is contains the entity field names, not database field (i.e. column) names. To get the mapping of specific entity field to database columns use ::getColumnNames().
string[]
getColumnNames(string $field_name)
Gets a mapping of field columns to database columns for a given field.
string[]
getExtraColumns(string $table_name)
Gets a list of extra database columns, which store denormalized data.
These database columns do not belong to any entity fields. Any normalized data that is stored should be associated with an entity field.
array
getReservedColumns()
Gets the list of columns that can not be used as field type columns.
string
getFieldColumnName(FieldStorageDefinitionInterface $storage_definition, string $property_name)
Generates a column name for a field property.
string
getFieldTableName(string $field_name)
Gets the table name for a given column.