You are here

protected function FileImport::getOverwriteMode in Migrate Files (extended) 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/migrate/process/FileImport.php \Drupal\migrate_file\Plugin\migrate\process\FileImport::getOverwriteMode()

Determines how to handle file conflicts.

Return value

int FILE_EXISTS_REPLACE (default), FILE_EXISTS_RENAME, or FILE_EXISTS_ERROR depending on the current configuration.

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

File

src/Plugin/migrate/process/FileImport.php, line 289

Class

FileImport
Imports a file from an local or external source.

Namespace

Drupal\migrate_file\Plugin\migrate\process

Code

protected function getOverwriteMode() {
  if (!empty($this->configuration['rename'])) {
    return FILE_EXISTS_RENAME;
  }
  if (!empty($this->configuration['reuse'])) {
    return FILE_EXISTS_ERROR;
  }
  return FILE_EXISTS_REPLACE;
}