public function SaveNode::execute in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/node/src/Plugin/Action/SaveNode.php \Drupal\node\Plugin\Action\SaveNode::execute()
Executes the plugin.
Overrides ExecutableInterface::execute
File
- core/
modules/ node/ src/ Plugin/ Action/ SaveNode.php, line 27 - Contains \Drupal\node\Plugin\Action\SaveNode.
Class
- SaveNode
- Provides an action that can save any entity.
Namespace
Drupal\node\Plugin\ActionCode
public function execute($entity = NULL) {
// We need to change at least one value, otherwise the changed timestamp
// will not be updated.
$entity->changed = 0;
$entity
->save();
}