protected function FieldConfigDeleteForm::getConfigNamesToDelete in Drupal 9
Same name and namespace in other branches
- 8 core/modules/field_ui/src/Form/FieldConfigDeleteForm.php \Drupal\field_ui\Form\FieldConfigDeleteForm::getConfigNamesToDelete()
Returns config names to delete for the deletion confirmation form.
Parameters
\Drupal\Core\Config\Entity\ConfigEntityInterface $entity: The entity being deleted.
Return value
string[] A list of configuration names that will be deleted by this form.
Overrides EntityDeleteForm::getConfigNamesToDelete
File
- core/
modules/ field_ui/ src/ Form/ FieldConfigDeleteForm.php, line 71
Class
- FieldConfigDeleteForm
- Provides a form for removing a field from a bundle.
Namespace
Drupal\field_ui\FormCode
protected function getConfigNamesToDelete(ConfigEntityInterface $entity) {
/** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
$field_storage = $entity
->getFieldStorageDefinition();
$config_names = [
$entity
->getConfigDependencyName(),
];
// If there is only one bundle left for this field storage, it will be
// deleted too, notify the user about dependencies.
if (count($field_storage
->getBundles()) <= 1) {
$config_names[] = $field_storage
->getConfigDependencyName();
}
return $config_names;
}