You are here

public function StickyNode::execute in Zircon Profile 8

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

Executes the plugin.

Overrides ExecutableInterface::execute

File

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

Class

StickyNode
Makes a node sticky.

Namespace

Drupal\node\Plugin\Action

Code

public function execute($entity = NULL) {
  $entity->sticky = NODE_STICKY;
  $entity
    ->save();
}