You are here

public function ILTDeleteForm::getDescription in Opigno Instructor-led Trainings 8

Same name and namespace in other branches
  1. 3.x src/Form/ILTDeleteForm.php \Drupal\opigno_ilt\Form\ILTDeleteForm::getDescription()

Returns additional text to display as a description.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form description.

Overrides ContentEntityConfirmFormBase::getDescription

File

src/Form/ILTDeleteForm.php, line 65

Class

ILTDeleteForm
Provides a form for deleting a opigno_ilt entity.

Namespace

Drupal\opigno_ilt\Form

Code

public function getDescription() {
  if ($this->hasResults) {
    return $this
      ->t('There are some results for this ILT, and it cannot consequently be deleted in order to keep the users achievements');
  }
  if ($this->hasTraining) {
    return $this
      ->t('This ILT is being used and it needs to be removed from the training(s) using it before being able to delete it.');
  }
  return $this
    ->t('This action cannot be undone.');
}