function SaveAction::execute
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()
- 10 core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()
- 9 core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()
- 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/SaveAction.php \Drupal\Core\Action\Plugin\Action\SaveAction::execute()
Executes the plugin.
phpcs:ignore Drupal.Commenting.FunctionComment.ParamNameNoMatch
@todo Uncomment the new $object method parameter before drupal:12.0.0.
Parameters
object|null $object: (optional) An object to execute the plugin on/with.
Overrides ExecutableInterface::execute
File
-
core/
lib/ Drupal/ Core/ Action/ Plugin/ Action/ SaveAction.php, line 51
Class
- SaveAction
- Provides an action that can save any entity.
Namespace
Drupal\Core\Action\Plugin\ActionCode
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.