public function PromoteNode::execute

Executes the plugin.

Overrides ExecutableInterface::execute

File

drupal/core/modules/node/lib/Drupal/node/Plugin/Action/PromoteNode.php, line 28
Contains \Drupal\node\Plugin\Action\PromoteNode.

Class

PromoteNode
Promotes a node.

Namespace

Drupal\node\Plugin\Action

Code

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