function BreakLockForm::getDescription

Same name and namespace in other branches
  1. 8.9.x core/modules/views_ui/src/Form/BreakLockForm.php \Drupal\views_ui\Form\BreakLockForm::getDescription()
  2. 10 core/modules/views_ui/src/Form/BreakLockForm.php \Drupal\views_ui\Form\BreakLockForm::getDescription()
  3. 11.x core/modules/views_ui/src/Form/BreakLockForm.php \Drupal\views_ui\Form\BreakLockForm::getDescription()

Overrides EntityConfirmFormBase::getDescription

File

core/modules/views_ui/src/Form/BreakLockForm.php, line 72

Class

BreakLockForm
Builds the form to break the lock of an edited view.

Namespace

Drupal\views_ui\Form

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.