NamedRange
extends DefinedName
in package
Table of Contents
Constants
- REGEXP_IDENTIFY_FORMULA = '[^_\p{N}\p{L}:, \$\'!]'
Properties
- $isFormula : bool
- Whether this is a named range or a named formula.
- $localOnly : bool
- Is the defined named local? (i.e. can only be used on $this->worksheet).
- $name : string
- Name.
- $scope : Worksheet|null
- Scope.
- $value : string
- Value of the named object.
- $worksheet : Worksheet|null
- Worksheet on which the defined name can be resolved.
Methods
- __clone() : mixed
- Implement PHP __clone to create a deep clone, not just a shallow copy.
- __construct() : mixed
- Create a new Named Range.
- __destruct() : mixed
- createInstance() : self
- Create a new defined name, either a range or a formula.
- getCellsInRange() : array<string|int, mixed>
- getLocalOnly() : bool
- Get localOnly.
- getName() : string
- Get name.
- getRange() : string
- Get the range value.
- getScope() : Worksheet|null
- Get scope.
- getValue() : string
- Get range or formula value.
- getWorksheet() : Worksheet|null
- Get worksheet.
- isFormula() : bool
- Identify whether this is a named range or a named formula.
- resolveName() : self|null
- Resolve a named range to a regular cell range or formula.
- setLocalOnly() : self
- Set localOnly.
- setName() : self
- Set name.
- setRange() : self
- Set the range value.
- setScope() : self
- Set scope.
- setValue() : self
- Set range or formula value.
- setWorksheet() : self
- Set worksheet.
- testIfFormula() : bool
Constants
REGEXP_IDENTIFY_FORMULA
protected
mixed
REGEXP_IDENTIFY_FORMULA
= '[^_\p{N}\p{L}:, \$\'!]'
Properties
$isFormula
Whether this is a named range or a named formula.
protected
bool
$isFormula
$localOnly
Is the defined named local? (i.e. can only be used on $this->worksheet).
protected
bool
$localOnly
$name
Name.
protected
string
$name
$scope
Scope.
protected
Worksheet|null
$scope
$value
Value of the named object.
protected
string
$value
$worksheet
Worksheet on which the defined name can be resolved.
protected
Worksheet|null
$worksheet
Methods
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
public
__clone() : mixed
__construct()
Create a new Named Range.
public
__construct(string $name[, Worksheet|null $worksheet = null ][, string $range = 'A1' ][, bool $localOnly = false ][, Worksheet|null $scope = null ]) : mixed
Parameters
__destruct()
public
__destruct() : mixed
createInstance()
Create a new defined name, either a range or a formula.
public
static createInstance(string $name[, Worksheet|null $worksheet = null ][, string|null $value = null ][, bool $localOnly = false ][, Worksheet|null $scope = null ]) : self
Parameters
- $name : string
- $worksheet : Worksheet|null = null
- $value : string|null = null
- $localOnly : bool = false
- $scope : Worksheet|null = null
Return values
selfgetCellsInRange()
public
getCellsInRange() : array<string|int, mixed>
Return values
array<string|int, mixed>getLocalOnly()
Get localOnly.
public
getLocalOnly() : bool
Return values
boolgetName()
Get name.
public
getName() : string
Return values
stringgetRange()
Get the range value.
public
getRange() : string
Return values
stringgetScope()
Get scope.
public
getScope() : Worksheet|null
Return values
Worksheet|nullgetValue()
Get range or formula value.
public
getValue() : string
Return values
stringgetWorksheet()
Get worksheet.
public
getWorksheet() : Worksheet|null
Return values
Worksheet|nullisFormula()
Identify whether this is a named range or a named formula.
public
isFormula() : bool
Return values
boolresolveName()
Resolve a named range to a regular cell range or formula.
public
static resolveName(string $definedName, Worksheet $worksheet[, string $sheetName = '' ]) : self|null
Parameters
- $definedName : string
- $worksheet : Worksheet
- $sheetName : string = ''
Return values
self|nullsetLocalOnly()
Set localOnly.
public
setLocalOnly(bool $localScope) : self
Parameters
- $localScope : bool
Return values
selfsetName()
Set name.
public
setName(string $name) : self
Parameters
- $name : string
Return values
selfsetRange()
Set the range value.
public
setRange(string $range) : self
Parameters
- $range : string
Return values
selfsetScope()
Set scope.
public
setScope(Worksheet|null $worksheet) : self
Parameters
- $worksheet : Worksheet|null
Return values
selfsetValue()
Set range or formula value.
public
setValue(string $value) : self
Parameters
- $value : string
Return values
selfsetWorksheet()
Set worksheet.
public
setWorksheet(Worksheet|null $worksheet) : self
Parameters
- $worksheet : Worksheet|null
Return values
selftestIfFormula()
public
static testIfFormula(string $value) : bool
Parameters
- $value : string