You are here

public function PHPExcel::getNamedRange in Loft Data Grids 7.2

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

Get named range

Parameters

string $namedRange:

PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope:

Return value

PHPExcel_NamedRange|null

File

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

Class

PHPExcel
PHPExcel

Code

public function getNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) {
  $returnValue = null;
  if ($namedRange != '' && $namedRange !== NULL) {

    // first look for global defined name
    if (isset($this->_namedRanges[$namedRange])) {
      $returnValue = $this->_namedRanges[$namedRange];
    }

    // then look for local defined name (has priority over global defined name if both names exist)
    if ($pSheet !== NULL && isset($this->_namedRanges[$pSheet
      ->getTitle() . '!' . $namedRange])) {
      $returnValue = $this->_namedRanges[$pSheet
        ->getTitle() . '!' . $namedRange];
    }
  }
  return $returnValue;
}