You are here

protected function DrupalPicture5Migration::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 DrupalFile5Migration::query

File

d5/file.inc, line 97
Implementation of DrupalFileMigration for Drupal 5 sources.

Class

DrupalPicture5Migration
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', 'filepath');
  return $query;
}