public function MediaService::updateMediaData in Gutenberg 8
Same name and namespace in other branches
- 8.2 src/Service/MediaService.php \Drupal\gutenberg\Service\MediaService::updateMediaData()
Update media data.
Parameters
string $fid: File entity ID.
array $data: Media data.
Throws
\Exception
File
- src/
Service/ MediaService.php, line 364
Class
- MediaService
- The media service class.
Namespace
Drupal\gutenberg\ServiceCode
public function updateMediaData(string $fid, array $data) {
$this->connection
->merge('file_managed_data')
->key([
'fid' => $fid,
])
->fields([
'data' => serialize($data),
])
->execute();
}