You are here

protected function VoteDeleteConfirm::getDeletionMessage in Voting API 8.3

Gets the message to display to the user after deleting the entity.

Return value

string The translated string of the deletion message.

Overrides EntityDeleteFormTrait::getDeletionMessage

File

src/Form/VoteDeleteConfirm.php, line 61

Class

VoteDeleteConfirm
Provides a form for vote deletion.

Namespace

Drupal\votingapi\Form

Code

protected function getDeletionMessage() {

  /** @var \Drupal\votingapi\Entity\Vote $vote */
  $vote = $this
    ->getEntity();
  $entity = $this->entityTypeManager
    ->getStorage($vote
    ->getVotedEntityType())
    ->load($vote
    ->getVotedEntityId());
  return $this
    ->t('The vote by %user on @entity-type %label has been deleted.', [
    '%user' => $vote
      ->getOwner()
      ->getDisplayName(),
    '@entity-type' => $entity
      ->getEntityType()
      ->getSingularLabel(),
    '%label' => $entity
      ->label(),
  ]);
}