class SaveNode

Provides an action that can save any entity.

Plugin annotation


@Action(
  id = "node_save_action",
  label = @Translation("Save content"),
  type = "node"
)

Hierarchy

Expanded class hierarchy of SaveNode

File

drupal/core/modules/node/lib/Drupal/node/Plugin/Action/SaveNode.php, line 23
Contains \Drupal\node\Plugin\Action\SaveNode.

Namespace

Drupal\node\Plugin\Action
View source
class SaveNode extends ActionBase {

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

}

Members

Namesort descending Modifiers Type Description Overrides
ActionBase::executeMultiple public function Executes the plugin for an array of objects. Overrides ActionInterface::executeMultiple 2
ContainerFactoryPluginBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 11
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::getPluginDefinition public function Returns the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::__construct public function Constructs a Drupal\Component\Plugin\PluginBase object. 17
SaveNode::execute public function Executes the plugin. Overrides ExecutableInterface::execute