You are here

public function PHPExcel_CachedObjectStorage_CacheBase::getHighestRow in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php \PHPExcel_CachedObjectStorage_CacheBase::getHighestRow()

* Get highest worksheet row *

Parameters

string $column Return the highest row for the specified column,: or the highest row of any column if no column letter is passed * @return int Highest row number

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/CacheBase.php, line 286

Class

PHPExcel_CachedObjectStorage_CacheBase
PHPExcel_CachedObjectStorage_CacheBase

Code

public function getHighestRow($column = null) {
  if ($column == null) {
    $colRow = $this
      ->getHighestRowAndColumn();
    return $colRow['row'];
  }
  $rowList = array(
    0,
  );
  foreach ($this
    ->getCellList() as $coord) {
    sscanf($coord, '%[A-Z]%d', $c, $r);
    if ($c != $column) {
      continue;
    }
    $rowList[] = $r;
  }
  return max($rowList);
}