function SaveAction::execute

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()
  2. 10 core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()
  3. 11.x core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()

Overrides ExecutableInterface::execute

File

core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php, line 63

Class

SaveAction
Provides an action that can save any entity.

Namespace

Drupal\Core\Action\Plugin\Action

Code

public function execute($entity = NULL) {
    $entity->setChangedTime($this->time
        ->getRequestTime())
        ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.