public function VoteDeleteConfirm::getDescription in Voting API 8.3
Returns additional text to display as a description.
Return value
\Drupal\Core\StringTranslation\TranslatableMarkup The form description.
Overrides EntityConfirmFormBase::getDescription
File
- src/
Form/ VoteDeleteConfirm.php, line 75
Class
- VoteDeleteConfirm
- Provides a form for vote deletion.
Namespace
Drupal\votingapi\FormCode
public function getDescription() {
/** @var \Drupal\votingapi\Entity\Vote $vote */
$vote = $this
->getEntity();
$entity = $this->entityTypeManager
->getStorage($vote
->getVotedEntityType())
->load($vote
->getVotedEntityId());
return $this
->t('You are about to delete a vote by %user on @entity-type %label. This action cannot be undone.', [
'%user' => $vote
->getOwner()
->getDisplayName(),
'@entity-type' => $entity
->getEntityType()
->getSingularLabel(),
'%label' => $entity
->label(),
]);
}