FilePlainFieldWidget.php in Media Migration 8
File
src/Plugin/migrate/source/d7/FilePlainFieldWidget.php
View source
<?php
namespace Drupal\media_migration\Plugin\migrate\source\d7;
use Drupal\migrate\Row;
class FilePlainFieldWidget extends FilePlainConfigSourceBase {
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
->prepareMediaSourceFieldWidgetRow($row, $this
->getDatabase());
return parent::prepareRow($row);
}
public function fields() {
return [
'options' => $this
->t('Configuration options of the source field widget.'),
] + parent::fields();
}
}