EntitySaveBase.php in Bibliography & Citation 8
File
modules/bibcite_entity/src/Plugin/Action/EntitySaveBase.php
View source
<?php
namespace Drupal\bibcite_entity\Plugin\Action;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;
class EntitySaveBase extends ActionBase {
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
return $object
->access('update', $account, $return_as_object);
}
public function execute($entity = NULL) {
$entity->changed = 0;
$entity
->save();
}
}