ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\NamedFormula Class Reference
+ Inheritance diagram for PhpOffice\PhpSpreadsheet\NamedFormula:
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\NamedFormula:

Public Member Functions

 __construct (string $name, ?Worksheet $worksheet=null, ?string $formula=null, bool $localOnly=false, ?Worksheet $scope=null)
 Create a new Named Formula. More...
 
 getFormula ()
 Get the formula value. More...
 
 setFormula (string $formula)
 Set the formula value. More...
 
- Public Member Functions inherited from PhpOffice\PhpSpreadsheet\DefinedName
 __construct (string $name, ?Worksheet $worksheet=null, ?string $value=null, bool $localOnly=false, ?Worksheet $scope=null)
 Create a new Defined Name. More...
 
 getName ()
 Get name. More...
 
 setName (string $name)
 Set name. More...
 
 getWorksheet ()
 Get worksheet. More...
 
 setWorksheet (?Worksheet $value)
 Set worksheet. More...
 
 getValue ()
 Get range or formula value. More...
 
 setValue (string $value)
 Set range or formula value. More...
 
 getLocalOnly ()
 Get localOnly. More...
 
 setLocalOnly (bool $value)
 Set localOnly. More...
 
 getScope ()
 Get scope. More...
 
 setScope (?Worksheet $value)
 Set scope. More...
 
 isFormula ()
 Identify whether this is a named range or a named formula. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PhpOffice\PhpSpreadsheet\DefinedName
static createInstance (string $name, ?Worksheet $worksheet=null, ?string $value=null, bool $localOnly=false, ?Worksheet $scope=null)
 Create a new defined name, either a range or a formula. More...
 
static testIfFormula (string $value)
 
static resolveName (string $pDefinedName, Worksheet $pSheet, string $sheetName='')
 Resolve a named range to a regular cell range or formula. More...
 
- Protected Attributes inherited from PhpOffice\PhpSpreadsheet\DefinedName
const REGEXP_IDENTIFY_FORMULA = '[^_\p{N}\p{L}:, \$\'!]'
 
 $name
 
 $worksheet
 
 $value
 
 $localOnly
 
 $scope
 
 $isFormula
 

Detailed Description

Definition at line 7 of file NamedFormula.php.

Constructor & Destructor Documentation

◆ __construct()

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

Create a new Named Formula.

Definition at line 12 of file NamedFormula.php.

References PhpOffice\PhpSpreadsheet\DefinedName\$localOnly, PhpOffice\PhpSpreadsheet\DefinedName\$scope, and PhpOffice\PhpSpreadsheet\DefinedName\$worksheet.

18  {
19  // Validate data
20  if (!isset($formula)) {
21  throw new Exception('You must specify a Formula value for a Named Formula');
22  }
23  parent::__construct($name, $worksheet, $formula, $localOnly, $scope);
24  }

Member Function Documentation

◆ getFormula()

PhpOffice\PhpSpreadsheet\NamedFormula::getFormula ( )

Get the formula value.

Definition at line 29 of file NamedFormula.php.

References PhpOffice\PhpSpreadsheet\DefinedName\$value.

29  : string
30  {
31  return $this->value;
32  }

◆ setFormula()

PhpOffice\PhpSpreadsheet\NamedFormula::setFormula ( string  $formula)

Set the formula value.

Definition at line 37 of file NamedFormula.php.

37  : self
38  {
39  if (!empty($formula)) {
40  $this->value = $formula;
41  }
42 
43  return $this;
44  }

The documentation for this class was generated from the following file: