You are here

public function Upload::prepareRow in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/file/src/Plugin/migrate/source/d6/Upload.php \Drupal\file\Plugin\migrate\source\d6\Upload::prepareRow()

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

core/modules/file/src/Plugin/migrate/source/d6/Upload.php, line 39

Class

Upload
Drupal 6 upload source from database.

Namespace

Drupal\file\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {
  $query = $this
    ->select('upload', 'u')
    ->fields('u', [
    'fid',
    'description',
    'list',
  ])
    ->condition('u.nid', $row
    ->getSourceProperty('nid'))
    ->orderBy('u.weight');
  $query
    ->innerJoin('node', 'n', static::JOIN);
  $row
    ->setSourceProperty('upload', $query
    ->execute()
    ->fetchAll());
  return parent::prepareRow($row);
}