Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

I include a function that gets the last row for a specific column. #242

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion Classes/PHPExcel/CachedObjectStorage/CacheBase.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
* @version 1.7.9, 2013-06-02
*/


Expand Down Expand Up @@ -274,6 +274,27 @@ public function getHighestRow()
}


/**
* it returns the highest row in a specific column
* getHighestRowSlow('C');
*/
public function getHighestRowbyColumn($column)
{
$rowList = array(0);

foreach ($this->getCellList() as $coord) {
sscanf($coord,'%[A-Z]%d', $c, $r);

if ($c != $column) {
continue;
}

$rowList[] = $r;
}

return max($rowList);
}

/**
* Generate a unique ID for cache referencing
*
Expand Down