ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\NamedRange Class Reference
+ Inheritance diagram for PhpOffice\PhpSpreadsheet\NamedRange:
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\NamedRange:

Public Member Functions

 __construct (string $name, ?Worksheet $worksheet=null, string $range='A1', bool $localOnly=false, ?Worksheet $scope=null)
 Create a new Named Range. More...
 
 getRange ()
 Get the range value. More...
 
 setRange (string $range)
 Set the range value. More...
 
 getCellsInRange ()
 
- Public Member Functions inherited from PhpOffice\PhpSpreadsheet\DefinedName
 __construct (string $name, ?Worksheet $worksheet=null, ?string $value=null, bool $localOnly=false, ?Worksheet $scope=null)
 Create a new Defined Name. More...
 
 getName ()
 Get name. More...
 
 setName (string $name)
 Set name. More...
 
 getWorksheet ()
 Get worksheet. More...
 
 setWorksheet (?Worksheet $value)
 Set worksheet. More...
 
 getValue ()
 Get range or formula value. More...
 
 setValue (string $value)
 Set range or formula value. More...
 
 getLocalOnly ()
 Get localOnly. More...
 
 setLocalOnly (bool $value)
 Set localOnly. More...
 
 getScope ()
 Get scope. More...
 
 setScope (?Worksheet $value)
 Set scope. More...
 
 isFormula ()
 Identify whether this is a named range or a named formula. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PhpOffice\PhpSpreadsheet\DefinedName
static createInstance (string $name, ?Worksheet $worksheet=null, ?string $value=null, bool $localOnly=false, ?Worksheet $scope=null)
 Create a new defined name, either a range or a formula. More...
 
static testIfFormula (string $value)
 
static resolveName (string $pDefinedName, Worksheet $pSheet, string $sheetName='')
 Resolve a named range to a regular cell range or formula. More...
 
- Protected Attributes inherited from PhpOffice\PhpSpreadsheet\DefinedName
const REGEXP_IDENTIFY_FORMULA = '[^_\p{N}\p{L}:, \$\'!]'
 
 $name
 
 $worksheet
 
 $value
 
 $localOnly
 
 $scope
 
 $isFormula
 

Detailed Description

Definition at line 8 of file NamedRange.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\NamedRange::__construct ( string  $name,
?Worksheet  $worksheet = null,
string  $range = 'A1',
bool  $localOnly = false,
?Worksheet  $scope = null 
)

Create a new Named Range.

Definition at line 13 of file NamedRange.php.

19 {
20 if ($worksheet === null && $scope === null) {
21 throw new Exception('You must specify a worksheet or a scope for a Named Range');
22 }
23 parent::__construct($name, $worksheet, $range, $localOnly, $scope);
24 }

References PhpOffice\PhpSpreadsheet\DefinedName\$localOnly, PhpOffice\PhpSpreadsheet\DefinedName\$name, PhpOffice\PhpSpreadsheet\DefinedName\$scope, and PhpOffice\PhpSpreadsheet\DefinedName\$worksheet.

Member Function Documentation

◆ getCellsInRange()

PhpOffice\PhpSpreadsheet\NamedRange::getCellsInRange ( )

Definition at line 46 of file NamedRange.php.

46 : array
47 {
48 $range = $this->value;
49 if (substr($range, 0, 1) === '=') {
50 $range = substr($range, 1);
51 }
52
54 }
static extractAllCellReferencesInRange($cellRange)
Extract all cell references in range, which may be comprised of multiple cell ranges.
Definition: Coordinate.php:338

References PhpOffice\PhpSpreadsheet\DefinedName\$value, and PhpOffice\PhpSpreadsheet\Cell\Coordinate\extractAllCellReferencesInRange().

+ Here is the call graph for this function:

◆ getRange()

PhpOffice\PhpSpreadsheet\NamedRange::getRange ( )

Get the range value.

Definition at line 29 of file NamedRange.php.

29 : string
30 {
31 return $this->value;
32 }

References PhpOffice\PhpSpreadsheet\DefinedName\$value.

◆ setRange()

PhpOffice\PhpSpreadsheet\NamedRange::setRange ( string  $range)

Set the range value.

Definition at line 37 of file NamedRange.php.

37 : self
38 {
39 if (!empty($range)) {
40 $this->value = $range;
41 }
42
43 return $this;
44 }

The documentation for this class was generated from the following file: