You are here

public function NodeMakePostPrivate::execute in Private 8

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/NodeMakePostPrivate.php, line 22

Class

NodeMakePostPrivate
Make post private.

Namespace

Drupal\private_content\Plugin\Action

Code

public function execute($entity = NULL) {
  $entity->private->value = 1;
  $entity
    ->save();
}