You are here

public function IndexBreakLockForm::getDescription in Search API 8

Returns additional text to display as a description.

Return value

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

Overrides EntityConfirmFormBase::getDescription

File

src/Form/IndexBreakLockForm.php, line 94

Class

IndexBreakLockForm
Builds the form to break the lock of an edited search index.

Namespace

Drupal\search_api\Form

Code

public function getDescription() {
  $locked = $this->tempStore
    ->getMetadata($this->entity
    ->id());
  $owner_id = $locked
    ->getOwnerId();
  $account = $this->entityTypeManager
    ->getStorage('user')
    ->load($owner_id);
  $username = [
    '#theme' => 'username',
    '#account' => $account,
  ];
  return $this
    ->t('By breaking this lock, any unsaved changes made by @user will be lost.', [
    '@user' => $this->renderer
      ->render($username),
  ]);
}