You are here

protected function File::initializeIterator in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/file/src/Plugin/migrate/source/d6/File.php \Drupal\file\Plugin\migrate\source\d6\File::initializeIterator()
  2. 8 core/modules/file/src/Plugin/migrate/source/d7/File.php \Drupal\file\Plugin\migrate\source\d7\File::initializeIterator()
Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Plugin/migrate/source/d6/File.php \Drupal\file\Plugin\migrate\source\d6\File::initializeIterator()

Implementation of MigrateSource::performRewind().

We could simply execute the query and be functionally correct, but we will take advantage of the PDO-based API to optimize the query up-front.

Overrides SqlBase::initializeIterator

File

core/modules/file/src/Plugin/migrate/source/d6/File.php, line 59
Contains \Drupal\file\Plugin\migrate\source\d6\File.

Class

File
Drupal 6 file source from database.

Namespace

Drupal\file\Plugin\migrate\source\d6

Code

protected function initializeIterator() {
  $site_path = isset($this->configuration['site_path']) ? $this->configuration['site_path'] : 'sites/default';
  $this->filePath = $this
    ->variableGet('file_directory_path', $site_path . '/files') . '/';
  $this->tempFilePath = $this
    ->variableGet('file_directory_temp', '/tmp') . '/';

  // FILE_DOWNLOADS_PUBLIC == 1 and FILE_DOWNLOADS_PRIVATE == 2.
  $this->isPublic = $this
    ->variableGet('file_downloads', 1) == 1;
  return parent::initializeIterator();
}