You are here

public function FilePlainSourceFieldInstance::prepareRow in Media Migration 8

File

src/Plugin/migrate/source/d7/FilePlainSourceFieldInstance.php, line 74

Class

FilePlainSourceFieldInstance
Drupal 7 media source field instances source based on source database.

Namespace

Drupal\media_migration\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
  [
    'mimes' => $mimes,
    'schemes' => $schemes,
  ] = $row
    ->getSource();
  $mime = explode(static::MULTIPLE_SEPARATOR, $mimes)[0];
  $scheme = explode(static::MULTIPLE_SEPARATOR, $schemes)[0];
  if (!($dealer_plugin = $this->fileDealerManager
    ->createInstanceFromSchemeAndMime($scheme, $mime))) {
    return FALSE;
  }
  $dealer_plugin
    ->prepareMediaSourceFieldInstanceRow($row, $this
    ->getDatabase());
  return parent::prepareRow($row);
}