You are here

public function FlagEvents::onUnflag in Message Subscribe 8

React to entity unflagging.

Parameters

\Drupal\flag\Event\UnflaggingEvent $event: The flagging event.

File

message_subscribe_email/src/EventSubscriber/FlagEvents.php, line 71

Class

FlagEvents
React to flag and unflag events.

Namespace

Drupal\message_subscribe_email\EventSubscriber

Code

public function onUnflag(UnflaggingEvent $event) {

  // Unflagging can happen in bulk, so loop through all flaggings.
  foreach ($event
    ->getFlaggings() as $flagging) {
    $this
      ->triggerEmailFlag($flagging, 'unflag');
  }
}