public function Spreadsheet::initializeIterator in Migrate Spreadsheet 8
Same name and namespace in other branches
- 2.0.x src/Plugin/migrate/source/Spreadsheet.php \Drupal\migrate_spreadsheet\Plugin\migrate\source\Spreadsheet::initializeIterator()
Initializes the iterator with the source data.
Return value
\Iterator Returns an iteratable object of data for this source.
Overrides SourcePluginBase::initializeIterator
1 call to Spreadsheet::initializeIterator()
- Spreadsheet::fields in src/
Plugin/ migrate/ source/ Spreadsheet.php - Returns available fields on the source.
File
- src/
Plugin/ migrate/ source/ Spreadsheet.php, line 163
Class
- Spreadsheet
- Provides a source plugin that migrate from spreadsheet files.
Namespace
Drupal\migrate_spreadsheet\Plugin\migrate\sourceCode
public function initializeIterator() {
if (!$this->iteratorIsInitialized) {
$configuration = $this
->getConfiguration();
$configuration['worksheet'] = $this
->loadWorksheet();
$configuration['keys'] = array_keys($configuration['keys']);
// The 'file' and 'plugin' items are not part of iterator configuration.
unset($configuration['file'], $configuration['plugin']);
$this->spreadsheetIterator
->setConfiguration($configuration);
// Flag that the iterator has been initialized.
$this->iteratorIsInitialized = TRUE;
}
return $this->spreadsheetIterator;
}