You are here

protected function DrupalPicture6Migration::query in Drupal-to-Drupal data migration 7.2

We override the file query to get the pictures from the user table.

Return value

SelectQueryInterface

Overrides DrupalFile6Migration::query

File

d6/file.inc, line 151
Implementation of DrupalFileMigration for Drupal 6 sources.

Class

DrupalPicture6Migration
Pull user pictures in their own migration class, based on normal file migration.

Code

protected function query() {
  $query = Database::getConnection('default', $this->sourceConnection)
    ->select('users', 'f')
    ->condition('picture', '', '<>')
    ->orderBy('access');
  $query
    ->addField('f', 'access');

  // Return the field name the file migration expects.
  $query
    ->addField('f', 'picture');
  return $query;
}