public function SpreadsheetIterator::getRowIndexColumn in Migrate Spreadsheet 2.0.x
Same name and namespace in other branches
- 8 src/SpreadsheetIterator.php \Drupal\migrate_spreadsheet\SpreadsheetIterator::getRowIndexColumn()
Gets the name of the row index column.
Return value
string|null A name to be given to the column returning the numeric index of the row.
Overrides SpreadsheetIteratorInterface::getRowIndexColumn
3 calls to SpreadsheetIterator::getRowIndexColumn()
- SpreadsheetIterator::current in src/
SpreadsheetIterator.php - SpreadsheetIterator::getKeys in src/
SpreadsheetIterator.php - Gets the list of columns that are composing the primary key.
- SpreadsheetIterator::key in src/
SpreadsheetIterator.php
File
- src/
SpreadsheetIterator.php, line 239
Class
- SpreadsheetIterator
- Provides a spreadsheet iterator.
Namespace
Drupal\migrate_spreadsheetCode
public function getRowIndexColumn() : ?string {
$column = $this->configuration['row_index_column'] ?? NULL;
if ($column) {
$headers = $this
->getHeaders();
if (isset($headers[$column])) {
throw new \InvalidArgumentException("The header column '{$column}' cannot be used as 'row_index_column'. Chose a value for 'row_index_column' that doesn't exist in header cells.");
}
}
return $column;
}