3 namespace Drupal\node\Plugin\Action;
5 use Drupal\Core\Action\ActionBase;
6 use Drupal\Core\Session\AccountInterface;
9 * Provides an action that can save any entity.
12 * id = "node_save_action",
13 * label = @Translation("Save content"),
17 class SaveNode extends ActionBase {
22 public function execute($entity = NULL) {
23 // We need to change at least one value, otherwise the changed timestamp
24 // will not be updated.
32 public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
33 /** @var \Drupal\node\NodeInterface $object */
34 return $object->access('update', $account, $return_as_object);