You are here

public function UnpublishComment::execute in Zircon Profile 8

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

Executes the plugin.

Overrides ExecutableInterface::execute

File

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

Class

UnpublishComment
Unpublishes a comment.

Namespace

Drupal\comment\Plugin\Action

Code

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