Same filename and directory in other branches
- 8.9.x core/lib/Drupal/Core/Entity/EntityDeleteForm.php
- 9 core/lib/Drupal/Core/Entity/EntityDeleteForm.php
Namespace
Drupal\Core\Entity
File
core/lib/Drupal/Core/Entity/EntityDeleteForm.php
View source
<?php
namespace Drupal\Core\Entity;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Form\FormStateInterface;
class EntityDeleteForm extends EntityConfirmFormBase {
use EntityDeleteFormTrait;
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::buildForm($form, $form_state);
$entity = $this
->getEntity();
if (!$entity instanceof ConfigEntityInterface) {
return $form;
}
$this
->addDependencyListsToForm($form, $entity
->getConfigDependencyKey(), $this
->getConfigNamesToDelete($entity), $this
->getConfigManager(), $this->entityTypeManager);
return $form;
}
protected function getConfigManager() {
return \Drupal::service('config.manager');
}
protected function getConfigNamesToDelete(ConfigEntityInterface $entity) {
return [
$entity
->getConfigDependencyName(),
];
}
}
Classes