public function MigrateSourceCSV::performRewind in Migrate 6.2
Same name and namespace in other branches
- 7.2 plugins/sources/csv.inc \MigrateSourceCSV::performRewind()
Implementation of MigrateSource::performRewind().
Return value
void
File
- plugins/
sources/ csv.inc, line 159 - Define a MigrateSource for importing from comma separated values files.
Class
- MigrateSourceCSV
- Implementation of MigrateSource, to handle imports from CSV files.
Code
public function performRewind() {
// Close any previously-opened handle
if (!is_null($this->csvHandle)) {
fclose($this->csvHandle);
$this->csvHandle = NULL;
}
// Load up the first row, skipping the header(s) if necessary
$this->csvHandle = fopen($this->file, 'r');
for ($i = 0; $i < $this->headerRows; $i++) {
$this
->getNextLine();
}
}