public function WebformEntityReferenceManager::getTableNames in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformEntityReferenceManager.php \Drupal\webform\WebformEntityReferenceManager::getTableNames()
Get the table names for all webform field instances.
Return value
array An associative array of webform field table names and webform field names.
Overrides WebformEntityReferenceManagerInterface::getTableNames
File
- src/
WebformEntityReferenceManager.php, line 348
Class
- WebformEntityReferenceManager
- Webform entity reference (field) manager.
Namespace
Drupal\webformCode
public function getTableNames() {
/** @var \Drupal\field\FieldStorageConfigInterface[] $field_storage_configs */
$field_storage_configs = FieldStorageConfig::loadMultiple();
$tables = [];
foreach ($field_storage_configs as $field_storage_config) {
if ($field_storage_config
->getType() === 'webform') {
$webform_field_table = $field_storage_config
->getTargetEntityTypeId();
$webform_field_name = $field_storage_config
->getName();
$tables[$webform_field_table . '__' . $webform_field_name] = $webform_field_name;
$tables[$webform_field_table . '_revision__' . $webform_field_name] = $webform_field_name;
}
}
return $tables;
}