ContentEntityDeleteForm::getQuestion

public ContentEntityDeleteForm::getQuestion()

Returns the question to ask the user.

Return value

string The form question. The page title will be set to this value.

Overrides ConfirmFormInterface::getQuestion

File

core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php, line 127

Class

ContentEntityDeleteForm
Provides a generic base class for a content entity deletion form.

Namespace

Drupal\Core\Entity

Code

public function getQuestion() {
  /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  $entity = $this->getEntity();

  if (!$entity->isDefaultTranslation()) {
    return $this->t('Are you sure you want to delete the @language translation of the @entity-type %label?', array(
      '@language' => $entity->language()->getName(),
      '@entity-type' => $this->getEntity()->getEntityType()->getLowercaseLabel(),
      '%label' => $this->getEntity()->label(),
    ));
  }

  return $this->traitGetQuestion();
}
doc_Drupal
2016-10-29 08:57:11
Comments
Leave a Comment

Please login to continue.