You are here

public function SpreadsheetIterator::getColumnsCount in Migrate Spreadsheet 2.0.x

Same name and namespace in other branches
  1. 8 src/SpreadsheetIterator.php \Drupal\migrate_spreadsheet\SpreadsheetIterator::getColumnsCount()

Gets the total number of columns in the worksheet.

Return value

int The total number of columns in the worksheet.

Overrides SpreadsheetIteratorInterface::getColumnsCount

2 calls to SpreadsheetIterator::getColumnsCount()
SpreadsheetIterator::getHeaders in src/SpreadsheetIterator.php
Retrieves a full list of headers.
SpreadsheetIterator::getOrigin in src/SpreadsheetIterator.php
Retrieves the top-left origin of data area.

File

src/SpreadsheetIterator.php, line 293

Class

SpreadsheetIterator
Provides a spreadsheet iterator.

Namespace

Drupal\migrate_spreadsheet

Code

public function getColumnsCount() : int {
  if (!isset($this->cache['columns_count'])) {
    $this->cache['columns_count'] = Coordinate::columnIndexFromString($this
      ->getWorksheet()
      ->getHighestDataColumn());
  }
  return $this->cache['columns_count'];
}