You are here

public function PHPExcel::getIndex in Loft Data Grids 6.2

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

Get index for sheet

Parameters

PHPExcel_Worksheet $pSheet:

Return value

Sheet index

Throws

PHPExcel_Exception

2 calls to PHPExcel::getIndex()
PHPExcel::setActiveSheetIndexByName in vendor/phpoffice/phpexcel/Classes/PHPExcel.php
Set active sheet index by name
PHPExcel::setIndexByName in vendor/phpoffice/phpexcel/Classes/PHPExcel.php
Set index for sheet by sheet name.

File

vendor/phpoffice/phpexcel/Classes/PHPExcel.php, line 620

Class

PHPExcel
PHPExcel

Code

public function getIndex(PHPExcel_Worksheet $pSheet) {
  foreach ($this->_workSheetCollection as $key => $value) {
    if ($value
      ->getHashCode() == $pSheet
      ->getHashCode()) {
      return $key;
    }
  }
  throw new PHPExcel_Exception("Sheet does not exist.");
}