You are here

public function VotingApiReactionManager::forgetReaction in Voting API Reaction 8

Remove reaction from session variable.

Parameters

\Drupal\votingapi\Entity\Vote $entity: Current vote entity.

File

src/VotingApiReactionManager.php, line 281

Class

VotingApiReactionManager
Manages reactions through Voting API entities.

Namespace

Drupal\votingapi_reaction

Code

public function forgetReaction(Vote $entity) {
  unset($_SESSION['votingapi_reaction'][implode(':', [
    $entity
      ->getVotedEntityId(),
    $entity
      ->getVotedEntityType(),
    $entity
      ->get('field_name')->value,
  ])]);
}