You are here

public function UnpublishNode::execute in Zircon Profile 8

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

Executes the plugin.

Overrides ExecutableInterface::execute

File

core/modules/node/src/Plugin/Action/UnpublishNode.php, line 27
Contains \Drupal\node\Plugin\Action\UnpublishNode.

Class

UnpublishNode
Unpublishes a node.

Namespace

Drupal\node\Plugin\Action

Code

public function execute($entity = NULL) {
  $entity->status = NODE_NOT_PUBLISHED;
  $entity
    ->save();
}