public function SpreadsheetIterator::getHeaderRow in Migrate Spreadsheet 2.0.x
Same name and namespace in other branches
- 8 src/SpreadsheetIterator.php \Drupal\migrate_spreadsheet\SpreadsheetIterator::getHeaderRow()
Gets the header row index.
Return value
int|null The header row index.
Overrides SpreadsheetIteratorInterface::getHeaderRow
1 call to SpreadsheetIterator::getHeaderRow()
- SpreadsheetIterator::getHeaders in src/
SpreadsheetIterator.php - Retrieves a full list of headers.
File
- src/
SpreadsheetIterator.php, line 225
Class
- SpreadsheetIterator
- Provides a spreadsheet iterator.
Namespace
Drupal\migrate_spreadsheetCode
public function getHeaderRow() : ?int {
if (!isset($this->cache['header_row'])) {
$header_row = $this->configuration['header_row'] ?? NULL;
if ($header_row !== NULL && (!is_numeric($this->configuration['header_row']) || $this->configuration['header_row'] < 1)) {
throw new \InvalidArgumentException("Wrong header_row value '{$this->configuration['header_row']}'.");
}
$this->cache['header_row'] = $header_row;
}
return $this->cache['header_row'];
}