public function PublishComment::execute

Executes the plugin.

Overrides ExecutableInterface::execute

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/Action/PublishComment.php, line 28
Contains \Drupal\comment\Plugin\Action\PublishComment.

Class

PublishComment
Publishes a comment.

Namespace

Drupal\comment\Plugin\Action

Code

public function execute($comment = NULL) {
  $comment->status->value = COMMENT_PUBLISHED;
  $comment
    ->save();
}