You are here

protected function CSV::getReader in Migrate Source CSV 8.3

Get the CSV reader.

Return value

\League\Csv\Reader The reader.

Throws

\Drupal\migrate\MigrateException

\League\Csv\Exception

File

src/Plugin/migrate/source/CSV.php, line 261

Class

CSV
Source for CSV files.

Namespace

Drupal\migrate_source_csv\Plugin\migrate\source

Code

protected function getReader() {
  $reader = $this
    ->createReader();
  $reader
    ->setDelimiter($this->configuration['delimiter']);
  $reader
    ->setEnclosure($this->configuration['enclosure']);
  $reader
    ->setEscape($this->configuration['escape']);
  $reader
    ->setHeaderOffset($this->configuration['header_offset']);
  return $reader;
}