SaveEntity.php in Drupal 9
File
core/modules/system/tests/modules/action_test/src/Plugin/Action/SaveEntity.php
View source
<?php
namespace Drupal\action_test\Plugin\Action;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;
class SaveEntity extends ActionBase {
public function execute($entity = NULL) {
$entity
->save();
}
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
return $object
->access('update', $account, $return_as_object);
}
}
Classes
Name |
Description |
SaveEntity |
Provides an operation to save user entities. |