SaveMedia.php in Media entity 8
File
src/Plugin/Action/SaveMedia.php
View source
<?php
namespace Drupal\media_entity\Plugin\Action;
use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;
class SaveMedia extends ActionBase {
public function execute($entity = NULL) {
$entity->changed = 0;
$entity
->save();
}
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
return $object
->access('update', $account, $return_as_object);
}
}
Classes
Name |
Description |
SaveMedia |
Provides an action that can save any entity. |