SaveNode.php

Contains \Drupal\node\Plugin\Action\SaveNode.

Namespace

Drupal\node\Plugin\Action

File

drupal/core/modules/node/lib/Drupal/node/Plugin/Action/SaveNode.php
View source
<?php

/**
 * @file
 * Contains \Drupal\node\Plugin\Action\SaveNode.
 */
namespace Drupal\node\Plugin\Action;

use Drupal\Core\Annotation\Action;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Action\ActionBase;

/**
 * Provides an action that can save any entity.
 *
 * @Action(
 *   id = "node_save_action",
 *   label = @Translation("Save content"),
 *   type = "node"
 * )
 */
class SaveNode extends ActionBase {

  /**
   * {@inheritdoc}
   */
  public function execute($entity = NULL) {
    $entity
      ->save();
  }

}

Classes

Namesort descending Description
SaveNode Provides an action that can save any entity.