You are here

public function CSVFileObject::__construct in Migrate Source CSV 8

Same name and namespace in other branches
  1. 8.2 src/CSVFileObject.php \Drupal\migrate_source_csv\CSVFileObject::__construct()

File

src/CSVFileObject.php, line 38
Contains \Drupal\migrate_source_csv\CSVFileObject.php.

Class

CSVFileObject
Defines a CSV file object.

Namespace

Drupal\migrate_source_csv

Code

public function __construct($file_name) {

  // Necessary to use this approach because SplFileObject doesn't like NULL
  // arguments passed to it.
  call_user_func_array([
    'parent',
    '__construct',
  ], func_get_args());
  $this
    ->setFlags(CSVFileObject::READ_CSV | CSVFileObject::READ_AHEAD | CSVFileObject::DROP_NEW_LINE | CSVFileObject::SKIP_EMPTY);
}