ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
NamedRange.php
Go to the documentation of this file.
1 <?php
2 
4 
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 
54  }
55 }
__construct(string $name, ?Worksheet $worksheet=null, string $range='A1', bool $localOnly=false, ?Worksheet $scope=null)
Create a new Named Range.
Definition: NamedRange.php:13
getRange()
Get the range value.
Definition: NamedRange.php:29
setRange(string $range)
Set the range value.
Definition: NamedRange.php:37
static extractAllCellReferencesInRange($cellRange)
Extract all cell references in range, which may be comprised of multiple cell ranges.
Definition: Coordinate.php:338