You are here

public function FilePlain::prepareRow in Media Migration 8

Adds additional data to the row.

Parameters

\Drupal\migrate\Row $row: The row object.

Return value

bool FALSE if this row needs to be skipped.

Overrides SourcePluginBase::prepareRow

File

src/Plugin/migrate/source/d7/FilePlain.php, line 133

Class

FilePlain
File Plain source plugin.

Namespace

Drupal\media_migration\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
  [
    'mime' => $mime,
    'scheme' => $scheme,
  ] = $row
    ->getSource();
  if (!($dealer_plugin = $this->fileDealerManager
    ->createInstanceFromSchemeAndMime($scheme, $mime))) {
    return FALSE;
  }
  $row
    ->setSourceProperty('bundle', $dealer_plugin
    ->getDestinationMediaTypeId());
  $dealer_plugin
    ->prepareMediaEntityRow($row, $this
    ->getDatabase());
  return parent::prepareRow($row);
}