public function SaveMedia::execute in Media entity 8
Same name and namespace in other branches
- 8.2 src/Plugin/Action/SaveMedia.php \Drupal\media_entity\Plugin\Action\SaveMedia::execute()
Executes the plugin.
Overrides ExecutableInterface::execute
File
- src/
Plugin/ Action/ SaveMedia.php, line 22
Class
- SaveMedia
- Provides an action that can save any entity.
Namespace
Drupal\media_entity\Plugin\ActionCode
public function execute($entity = NULL) {
// We need to change at least one value, otherwise the changed timestamp
// will not be updated.
$entity->changed = 0;
$entity
->save();
}