public function SpreadsheetIterator::getWorksheet in Migrate Spreadsheet 8
Same name and namespace in other branches
- 2.0.x src/SpreadsheetIterator.php \Drupal\migrate_spreadsheet\SpreadsheetIterator::getWorksheet()
Gets the worksheet.
Return value
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet The PHP Office worksheet object.
Throws
\InvalidArgumentException If an empty or invalid 'worksheet' has been passed.
Overrides SpreadsheetIteratorInterface::getWorksheet
File
- src/
SpreadsheetIterator.php, line 143
Class
- SpreadsheetIterator
- Provides a spreadsheet iterator.
Namespace
Drupal\migrate_spreadsheetCode
public function getWorksheet() {
if (!isset($this->cache['worksheet'])) {
if (empty($this->configuration['worksheet']) || !$this->configuration['worksheet'] instanceof Worksheet) {
throw new \InvalidArgumentException("No valid 'worksheet' configuration.");
}
$this->cache['worksheet'] = $this->configuration['worksheet'];
}
return $this->cache['worksheet'];
}