NamedFormula
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 Formula.
- __destruct() : mixed
- createInstance() : self
- Create a new defined name, either a range or a formula.
- getFormula() : string
- Get the formula value.
- getLocalOnly() : bool
- Get localOnly.
- getName() : string
- Get name.
- 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.
- setFormula() : self
- Set the formula value.
- setLocalOnly() : self
- Set localOnly.
- setName() : self
- Set name.
- 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 Formula.
public
__construct(string $name[, Worksheet|null $worksheet = null ][, string|null $formula = null ][, 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
selfgetFormula()
Get the formula value.
public
getFormula() : string
Return values
stringgetLocalOnly()
Get localOnly.
public
getLocalOnly() : bool
Return values
boolgetName()
Get name.
public
getName() : 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|nullsetFormula()
Set the formula value.
public
setFormula(string $formula) : self
Parameters
- $formula : string
Return values
selfsetLocalOnly()
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
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