You are here

public function Fallback::prepareMediaSourceFieldInstanceRow in Media Migration 8

Overrides MediaDealerBase::prepareMediaSourceFieldInstanceRow

File

src/Plugin/media_migration/file/Fallback.php, line 96

Class

Fallback
General plugin for any kind of file.

Namespace

Drupal\media_migration\Plugin\media_migration\file

Code

public function prepareMediaSourceFieldInstanceRow(Row $row, Connection $connection) : void {
  parent::prepareMediaSourceFieldInstanceRow($row, $connection);
  $show_description_field = FALSE;
  foreach ($this
    ->getFileFieldData($connection, FALSE) as $data) {
    if (!empty($data['field_instance_data']['settings']['description_field'])) {
      $show_description_field = TRUE;
      break 1;
    }
  }
  $row
    ->setSourceProperty('settings/description_field', $show_description_field);
}