You are here

public function BrightcoveEntityDeleteForm::getQuestion in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/Form/BrightcoveEntityDeleteForm.php \Drupal\brightcove\Form\BrightcoveEntityDeleteForm::getQuestion()
  2. 3.x src/Form/BrightcoveEntityDeleteForm.php \Drupal\brightcove\Form\BrightcoveEntityDeleteForm::getQuestion()

Returns the question to ask the user.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form question. The page title will be set to this value.

Overrides ContentEntityDeleteForm::getQuestion

File

src/Form/BrightcoveEntityDeleteForm.php, line 36

Class

BrightcoveEntityDeleteForm
Builds form for Brightcove content entity delete.

Namespace

Drupal\brightcove\Form

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?', [
      '@language' => $entity
        ->language()
        ->getName(),
      '@entity-type' => $this
        ->getEntity()
        ->getEntityType()
        ->getLabel(),
      '%label' => $this
        ->getEntity()
        ->label(),
    ]);
  }
  return $this
    ->t('Are you sure you want to delete the @entity-type %label?', [
    '@entity-type' => $this
      ->getEntity()
      ->getEntityType()
      ->getLabel(),
    '%label' => $this
      ->getEntity()
      ->label(),
  ]);
}