You are here

public function SimplesamlphpCustomAttributesDeleteForm::getQuestion in SimpleSAMLphp Custom Attribute Mapping 8

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 ConfirmFormInterface::getQuestion

File

src/Form/SimplesamlphpCustomAttributesDeleteForm.php, line 94

Class

SimplesamlphpCustomAttributesDeleteForm

Namespace

Drupal\simplesamlphp_custom_attributes\Form

Code

public function getQuestion() {

  // Get the pretty label for the message.
  $fields = $this->entityFieldManager
    ->getFieldDefinitions('user', 'user');
  if (isset($fields[$this->fieldName])) {
    $field_name = $fields[$this->fieldName]
      ->getLabel();
  }
  else {
    $field_name = $this
      ->t('Custom');
  }
  return $this
    ->t('Are you sure you want to delete the ":attribute > :field" mapping?', [
    ':attribute' => $this->attributeName,
    ':field' => $field_name,
  ]);
}