You are here

public function SaveMessage::execute in Message UI 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/SaveMessage.php, line 22

Class

SaveMessage
Provides an action that can save any message.

Namespace

Drupal\message_ui\Plugin\Action

Code

public function execute($entity = NULL) {

  // We need to change at least one value, otherwise the changed timestamp
  // will not be updated.
  $entity->changed = 0;
  $entity
    ->save();
}