You are here

public function DigestInterval::execute in Message Digest 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

message_digest_ui/src/Plugin/Action/DigestInterval.php, line 85

Class

DigestInterval
Action to change digest interval.

Namespace

Drupal\message_digest_ui\Plugin\Action

Code

public function execute($entity = NULL) {
  $flagging = $this->flagService
    ->getFlagging($this->flag, $entity);
  if (!$flagging) {
    $flagging = $this->flagService
      ->flag($this->flag, $entity);
  }
  $flagging->message_digest = $this->intervalPluginId;
  $flagging
    ->save();
}