function DefaultTableMapping::getAllFieldTableNames
Same name and namespace in other branches
- 10 core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php \Drupal\Core\Entity\Sql\DefaultTableMapping::getAllFieldTableNames()
- 11.x core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php \Drupal\Core\Entity\Sql\DefaultTableMapping::getAllFieldTableNames()
Gets all the table names in which an entity field is stored.
The returned table names are ordered by the amount of data stored in each table. For example, a revisionable and translatable entity type which uses core's default table mapping strategy would return the table names for the entity ID field in the following order:
- base table
- data table
- revision table
- revision data table
Parameters
string $field_name: The name of the entity field to return the tables names for.
Return value
string[] An array of table names in which the given field is stored.
Overrides TableMappingInterface::getAllFieldTableNames
File
-
core/
lib/ Drupal/ Core/ Entity/ Sql/ DefaultTableMapping.php, line 401
Class
- DefaultTableMapping
- Defines a default table mapping class.
Namespace
Drupal\Core\Entity\SqlCode
public function getAllFieldTableNames($field_name) {
return array_keys(array_filter($this->fieldNames, function ($table_fields) use ($field_name) {
return in_array($field_name, $table_fields, TRUE);
}));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.