ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPExcel_NamedRange Class Reference
+ Collaboration diagram for PHPExcel_NamedRange:

Public Member Functions

 __construct ($pName=null, PHPExcel_Worksheet $pWorksheet, $pRange='A1', $pLocalOnly=false, $pScope=null)
 Create a new NamedRange. More...
 
 getName ()
 Get name. More...
 
 setName ($value=null)
 Set name. More...
 
 getWorksheet ()
 Get worksheet. More...
 
 setWorksheet (PHPExcel_Worksheet $value=null)
 Set worksheet. More...
 
 getRange ()
 Get range. More...
 
 setRange ($value=null)
 Set range. More...
 
 getLocalOnly ()
 Get localOnly. More...
 
 setLocalOnly ($value=false)
 Set localOnly. More...
 
 getScope ()
 Get scope. More...
 
 setScope (PHPExcel_Worksheet $value=null)
 Set scope. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Static Public Member Functions

static resolveRange ($pNamedRange='', PHPExcel_Worksheet $pSheet)
 Resolve a named range to a regular cell range. More...
 

Private Attributes

 $_name
 
 $_worksheet
 
 $_range
 
 $_localOnly
 
 $_scope
 

Detailed Description

Definition at line 36 of file NamedRange.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_NamedRange::__construct (   $pName = null,
PHPExcel_Worksheet  $pWorksheet,
  $pRange = 'A1',
  $pLocalOnly = false,
  $pScope = null 
)

Create a new NamedRange.

Parameters
string$pName
PHPExcel_Worksheet$pWorksheet
string$pRange
bool$pLocalOnly
PHPExcel_Worksheet | null$pScopeScope. Only applies when $pLocalOnly = true. Null for global scope.
Exceptions
PHPExcel_Exception

Definition at line 83 of file NamedRange.php.

84  {
85  // Validate data
86  if (($pName === NULL) || ($pWorksheet === NULL) || ($pRange === NULL)) {
87  throw new PHPExcel_Exception('Parameters can not be null.');
88  }
89 
90  // Set local members
91  $this->_name = $pName;
92  $this->_worksheet = $pWorksheet;
93  $this->_range = $pRange;
94  $this->_localOnly = $pLocalOnly;
95  $this->_scope = ($pLocalOnly == true) ?
96  (($pScope == null) ? $pWorksheet : $pScope) : null;
97  }

Member Function Documentation

◆ __clone()

PHPExcel_NamedRange::__clone ( )

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

Definition at line 236 of file NamedRange.php.

236  {
237  $vars = get_object_vars($this);
238  foreach ($vars as $key => $value) {
239  if (is_object($value)) {
240  $this->$key = clone $value;
241  } else {
242  $this->$key = $value;
243  }
244  }
245  }

◆ getLocalOnly()

PHPExcel_NamedRange::getLocalOnly ( )

Get localOnly.

Returns
bool

Definition at line 185 of file NamedRange.php.

References $_localOnly.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange().

185  {
186  return $this->_localOnly;
187  }
+ Here is the caller graph for this function:

◆ getName()

PHPExcel_NamedRange::getName ( )

Get name.

Returns
string

Definition at line 104 of file NamedRange.php.

References $_name.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange(), and PHPExcel\addNamedRange().

104  {
105  return $this->_name;
106  }
+ Here is the caller graph for this function:

◆ getRange()

PHPExcel_NamedRange::getRange ( )

Get range.

Returns
string

Definition at line 163 of file NamedRange.php.

References $_range.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange().

163  {
164  return $this->_range;
165  }
+ Here is the caller graph for this function:

◆ getScope()

PHPExcel_NamedRange::getScope ( )

Get scope.

Returns
PHPExcel_Worksheet|null

Definition at line 206 of file NamedRange.php.

References $_scope.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange(), and PHPExcel\addNamedRange().

206  {
207  return $this->_scope;
208  }
+ Here is the caller graph for this function:

◆ getWorksheet()

PHPExcel_NamedRange::getWorksheet ( )

Get worksheet.

Returns
PHPExcel_Worksheet

Definition at line 141 of file NamedRange.php.

References $_worksheet.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange().

141  {
142  return $this->_worksheet;
143  }
+ Here is the caller graph for this function:

◆ resolveRange()

static PHPExcel_NamedRange::resolveRange (   $pNamedRange = '',
PHPExcel_Worksheet  $pSheet 
)
static

Resolve a named range to a regular cell range.

Parameters
string$pNamedRangeNamed range
PHPExcel_Worksheet | null$pSheetScope. Use null for global scope
Returns
PHPExcel_NamedRange

Definition at line 229 of file NamedRange.php.

References PHPExcel_Worksheet\getParent().

Referenced by PHPExcel_Worksheet\cellExists(), PHPExcel_Calculation\extractNamedRange(), PHPExcel_Worksheet\getCell(), and PHPExcel_Worksheet\namedRangeToArray().

229  {
230  return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet);
231  }
getParent()
Get parent.
Definition: Worksheet.php:786
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocalOnly()

PHPExcel_NamedRange::setLocalOnly (   $value = false)

Set localOnly.

Parameters
bool$value
Returns
PHPExcel_NamedRange

Definition at line 195 of file NamedRange.php.

195  {
196  $this->_localOnly = $value;
197  $this->_scope = $value ? $this->_worksheet : null;
198  return $this;
199  }

◆ setName()

PHPExcel_NamedRange::setName (   $value = null)

Set name.

Parameters
string$value
Returns
PHPExcel_NamedRange

Definition at line 114 of file NamedRange.php.

References $_name, and PHPExcel_ReferenceHelper\getInstance().

114  {
115  if ($value !== NULL) {
116  // Old title
117  $oldTitle = $this->_name;
118 
119  // Re-attach
120  if ($this->_worksheet !== NULL) {
121  $this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet);
122  }
123  $this->_name = $value;
124 
125  if ($this->_worksheet !== NULL) {
126  $this->_worksheet->getParent()->addNamedRange($this);
127  }
128 
129  // New title
130  $newTitle = $this->_name;
131  PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle);
132  }
133  return $this;
134  }
static getInstance()
Get an instance of this class.
+ Here is the call graph for this function:

◆ setRange()

PHPExcel_NamedRange::setRange (   $value = null)

Set range.

Parameters
string$value
Returns
PHPExcel_NamedRange

Definition at line 173 of file NamedRange.php.

173  {
174  if ($value !== NULL) {
175  $this->_range = $value;
176  }
177  return $this;
178  }

◆ setScope()

PHPExcel_NamedRange::setScope ( PHPExcel_Worksheet  $value = null)

Set scope.

Parameters
PHPExcel_Worksheet | null$value
Returns
PHPExcel_NamedRange

Definition at line 216 of file NamedRange.php.

216  {
217  $this->_scope = $value;
218  $this->_localOnly = ($value == null) ? false : true;
219  return $this;
220  }

◆ setWorksheet()

PHPExcel_NamedRange::setWorksheet ( PHPExcel_Worksheet  $value = null)

Set worksheet.

Parameters
PHPExcel_Worksheet$value
Returns
PHPExcel_NamedRange

Definition at line 151 of file NamedRange.php.

151  {
152  if ($value !== NULL) {
153  $this->_worksheet = $value;
154  }
155  return $this;
156  }

Field Documentation

◆ $_localOnly

PHPExcel_NamedRange::$_localOnly
private

Definition at line 64 of file NamedRange.php.

Referenced by getLocalOnly().

◆ $_name

PHPExcel_NamedRange::$_name
private

Definition at line 43 of file NamedRange.php.

Referenced by getName(), and setName().

◆ $_range

PHPExcel_NamedRange::$_range
private

Definition at line 57 of file NamedRange.php.

Referenced by getRange().

◆ $_scope

PHPExcel_NamedRange::$_scope
private

Definition at line 71 of file NamedRange.php.

Referenced by getScope().

◆ $_worksheet

PHPExcel_NamedRange::$_worksheet
private

Definition at line 50 of file NamedRange.php.

Referenced by getWorksheet().


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