EntityDeleteFormTrait
trait EntityDeleteFormTrait (View source)
Provides a trait for an entity deletion form.
This trait relies on the StringTranslationTrait and the logger method added by FormBase.
Traits
Lists affected configuration entities by a dependency removal.
Methods
Translates a string to the current language or to a given language.
Adds form elements to list affected configuration entities.
Gets the entity of this form.
Gets the logger for a specific channel.
{@inheritdoc}
{@inheritdoc}
Gets the message to display to the user after deleting the entity.
{@inheritdoc}
Returns the URL where the user should be redirected after deletion.
Logs a message about the deleted entity.
Details
abstract protected
t($string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
Provided by \Drupal\Core\StringTranslation\StringTranslationTrait.
protected
addDependencyListsToForm(array $form, string $type, array $names, ConfigManagerInterface $config_manager, EntityTypeManagerInterface $entity_type_manager)
Adds form elements to list affected configuration entities.
abstract EntityInterface
getEntity()
Gets the entity of this form.
Provided by \Drupal\Core\Entity\EntityForm.
abstract protected LoggerInterface
logger(string $channel)
Gets the logger for a specific channel.
Provided by \Drupal\Core\Form\FormBase.
getQuestion()
{@inheritdoc}
getConfirmText()
{@inheritdoc}
protected string
getDeletionMessage()
Gets the message to display to the user after deleting the entity.
getCancelUrl()
{@inheritdoc}
protected Url
getRedirectUrl()
Returns the URL where the user should be redirected after deletion.
protected
logDeletionMessage()
Logs a message about the deleted entity.
submitForm(array $form, FormStateInterface $form_state)
{@inheritdoc}