Constants

REGEXP_IDENTIFY_FORMULA

REGEXP_IDENTIFY_FORMULA = '[^_\\p{N}\\p{L}:, \\$\'!]'

Properties

$name

$name : string

Name.

Type

string

$worksheet

$worksheet : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Worksheet on which the defined name can be resolved.

Type

Worksheet

$value

$value : string

Value of the named object.

Type

string

$localOnly

$localOnly : bool

Is the defined named local? (i.e. can only be used on $this->worksheet).

Type

bool

$scope

$scope : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Scope.

Type

Worksheet

$isFormula

$isFormula : bool

Whether this is a named range or a named formula.

Type

bool

Methods

__construct()

__construct(string  $name, ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $worksheet = null, ?string  $formula = null, bool  $localOnly = false, ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $scope = null) : mixed

Create a new Named Formula.

Parameters

string $name
?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet
?string $formula
bool $localOnly
?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $scope

Returns

mixed —

createInstance()

createInstance(string  $name, ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $worksheet = null, ?string  $value = null, bool  $localOnly = false, ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $scope = null) : self

Create a new defined name, either a range or a formula.

Parameters

string $name
?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet
?string $value
bool $localOnly
?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $scope

Returns

self —

testIfFormula()

testIfFormula(string  $value) : bool

Parameters

string $value

Returns

bool —

getName()

getName() : string

Get name.

Returns

string —

setName()

setName(string  $name) : self

Set name.

Parameters

string $name

Returns

self —

getWorksheet()

getWorksheet() : ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Get worksheet.

Returns

?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet —

setWorksheet()

setWorksheet(?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $value) : self

Set worksheet.

Parameters

?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $value

Returns

self —

getValue()

getValue() : string

Get range or formula value.

Returns

string —

setValue()

setValue(string  $value) : self

Set range or formula value.

Parameters

string $value

Returns

self —

getLocalOnly()

getLocalOnly() : bool

Get localOnly.

Returns

bool —

setLocalOnly()

setLocalOnly(bool  $value) : self

Set localOnly.

Parameters

bool $value

Returns

self —

getScope()

getScope() : ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Get scope.

Returns

?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet —

setScope()

setScope(?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $value) : self

Set scope.

Parameters

?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $value

Returns

self —

isFormula()

isFormula() : bool

Identify whether this is a named range or a named formula.

Returns

bool —

resolveName()

resolveName(string  $pDefinedName, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $pSheet) : ?self

Resolve a named range to a regular cell range or formula.

Parameters

string $pDefinedName
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet

Returns

?self —

__clone()

__clone() : mixed

Implement PHP __clone to create a deep clone, not just a shallow copy.

Returns

mixed —

getFormula()

getFormula() : string

Get the formula value.

Returns

string —

setFormula()

setFormula(string  $formula) : self

Set the formula value.

Parameters

string $formula

Returns

self —