You are here

protected function File::initializeIterator in Drupal 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. 9 core/modules/file/src/Plugin/migrate/source/d6/File.php \Drupal\file\Plugin\migrate\source\d6\File::initializeIterator()
  2. 10 core/modules/file/src/Plugin/migrate/source/d6/File.php \Drupal\file\Plugin\migrate\source\d6\File::initializeIterator()

Initializes the iterator with the source data.

Return value

\Iterator Returns an iteratable object of data for this source.

Overrides SqlBase::initializeIterator

File

core/modules/file/src/Plugin/migrate/source/d6/File.php, line 56

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();
}