You are here

public function CsvParser::rewind in Feeds 8.3

Implements \Iterator::rewind().

File

src/Component/CsvParser.php, line 238

Class

CsvParser
Parses an RFC 4180 style CSV file.

Namespace

Drupal\feeds\Component

Code

public function rewind() {
  rewind($this->handle);
  if ($this->hasHeader && !$this->startByte) {
    $this
      ->parseLine($this
      ->readLine());
  }
  elseif ($this->startByte) {
    fseek($this->handle, $this->startByte);
  }
  $this->linesRead = 0;

  // Preemptively advance to the next line.
  $this
    ->next();
}