You are here

public function PublishComment::execute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Plugin/Action/PublishComment.php \Drupal\comment\Plugin\Action\PublishComment::execute()

Executes the plugin.

Overrides ExecutableInterface::execute

File

core/modules/comment/src/Plugin/Action/PublishComment.php, line 27
Contains \Drupal\comment\Plugin\Action\PublishComment.

Class

PublishComment
Publishes a comment.

Namespace

Drupal\comment\Plugin\Action

Code

public function execute($comment = NULL) {
  $comment
    ->setPublished(TRUE);
  $comment
    ->save();
}