ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
NamedRange.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet
;
4
5
use
PhpOffice\PhpSpreadsheet\Cell\Coordinate
;
6
use
PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
;
7
8
class
NamedRange
extends
DefinedName
9
{
13
public
function
__construct
(
14
string
$name
,
15
?
Worksheet
$worksheet
= null,
16
string
$range =
'A1'
,
17
bool
$localOnly
=
false
,
18
?
Worksheet
$scope
= null
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
}
25
29
public
function
getRange
(): string
30
{
31
return
$this->value
;
32
}
33
37
public
function
setRange
(
string
$range): self
38
{
39
if
(!empty($range)) {
40
$this->value = $range;
41
}
42
43
return
$this;
44
}
45
46
public
function
getCellsInRange
(): array
47
{
48
$range =
$this->value
;
49
if
(substr($range, 0, 1) ===
'='
) {
50
$range = substr($range, 1);
51
}
52
53
return
Coordinate::extractAllCellReferencesInRange
($range);
54
}
55
}
PhpOffice\PhpSpreadsheet\NamedRange\getCellsInRange
getCellsInRange()
Definition:
NamedRange.php:46
PhpOffice\PhpSpreadsheet\DefinedName
Definition:
DefinedName.php:7
Worksheet
PhpOffice\PhpSpreadsheet\NamedRange
Definition:
NamedRange.php:8
PhpOffice\PhpSpreadsheet\DefinedName\$localOnly
$localOnly
Definition:
DefinedName.php:37
Coordinate
PhpOffice\PhpSpreadsheet\NamedRange\__construct
__construct(string $name, ?Worksheet $worksheet=null, string $range='A1', bool $localOnly=false, ?Worksheet $scope=null)
Create a new Named Range.
Definition:
NamedRange.php:13
PhpOffice\PhpSpreadsheet\DefinedName\$name
$name
Definition:
DefinedName.php:16
PhpOffice\PhpSpreadsheet\NamedRange\getRange
getRange()
Get the range value.
Definition:
NamedRange.php:29
PhpOffice\PhpSpreadsheet\DefinedName\$worksheet
$worksheet
Definition:
DefinedName.php:23
PhpOffice\PhpSpreadsheet\NamedRange\setRange
setRange(string $range)
Set the range value.
Definition:
NamedRange.php:37
PhpOffice\PhpSpreadsheet
PhpOffice\PhpSpreadsheet\DefinedName\$value
$value
Definition:
DefinedName.php:30
PhpOffice\PhpSpreadsheet\Cell\Coordinate\extractAllCellReferencesInRange
static extractAllCellReferencesInRange($cellRange)
Extract all cell references in range, which may be comprised of multiple cell ranges.
Definition:
Coordinate.php:338
php
PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
Definition:
Worksheet.php:28
PhpOffice\PhpSpreadsheet\DefinedName\$scope
$scope
Definition:
DefinedName.php:44
Exception
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
NamedRange.php
Generated on Thu Jan 16 2025 19:01:46 for ILIAS by
1.8.13 (using
Doxyfile
)