You are here

protected function MediaFileCopy::saveFile in Migrate File Entities to Media Entities 8

Save file to a defined destination.

1 call to MediaFileCopy::saveFile()
MediaFileCopy::transform in src/Plugin/migrate/process/MediaFileCopy.php
Performs the associated process.

File

src/Plugin/migrate/process/MediaFileCopy.php, line 134

Class

MediaFileCopy
Copies or local file for usage in media module.

Namespace

Drupal\migrate_file_to_media\Plugin\migrate\process

Code

protected function saveFile($source, $destination, $replace = FileSystemInterface::EXISTS_RENAME) {
  $data = file_get_contents($source);
  $file = file_save_data($data, $destination, $replace);
  return $file;
}