ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 getName ()
 Get name.
 setName ($value=null)
 Set name.
 getWorksheet ()
 Get worksheet.
 setWorksheet (PHPExcel_Worksheet $value=null)
 Set worksheet.
 getRange ()
 Get range.
 setRange ($value=null)
 Set range.
 getLocalOnly ()
 Get localOnly.
 setLocalOnly ($value=false)
 Set localOnly.
 getScope ()
 Get scope.
 setScope (PHPExcel_Worksheet $value=null)
 Set scope.
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.

Static Public Member Functions

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

Private Attributes

 $_name
 $_worksheet
 $_range
 $_localOnly
 $_scope

Detailed Description

Definition at line 36 of file NamedRange.php.

Constructor & Destructor Documentation

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.

Definition at line 82 of file NamedRange.php.

{
// Validate data
if (is_null($pName) || is_null($pWorksheet)|| is_null($pRange)) {
throw new Exception('Parameters can not be null.');
}
// Set local members
$this->_name = $pName;
$this->_worksheet = $pWorksheet;
$this->_range = $pRange;
$this->_localOnly = $pLocalOnly;
$this->_scope = ($pLocalOnly == true) ?
(($pScope == null) ? $pWorksheet : $pScope) : null;
}

Member Function Documentation

PHPExcel_NamedRange::__clone ( )

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

Definition at line 235 of file NamedRange.php.

{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
PHPExcel_NamedRange::getLocalOnly ( )

Get localOnly.

Returns
bool

Definition at line 184 of file NamedRange.php.

References $_localOnly.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange().

{
}

+ Here is the caller graph for this function:

PHPExcel_NamedRange::getName ( )

Get name.

Returns
string

Definition at line 103 of file NamedRange.php.

References $_name.

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

{
return $this->_name;
}

+ Here is the caller graph for this function:

PHPExcel_NamedRange::getRange ( )

Get range.

Returns
string

Definition at line 162 of file NamedRange.php.

References $_range.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange().

{
return $this->_range;
}

+ Here is the caller graph for this function:

PHPExcel_NamedRange::getScope ( )

Get scope.

Returns
PHPExcel_Worksheet|null

Definition at line 205 of file NamedRange.php.

References $_scope.

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

{
return $this->_scope;
}

+ Here is the caller graph for this function:

PHPExcel_NamedRange::getWorksheet ( )

Get worksheet.

Returns
PHPExcel_Worksheet

Definition at line 140 of file NamedRange.php.

References $_worksheet.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange().

{
}

+ Here is the caller graph for this function:

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 228 of file NamedRange.php.

References PHPExcel_Worksheet\getParent().

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

{
return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_NamedRange::setLocalOnly (   $value = false)

Set localOnly.

Parameters
bool$value
Returns
PHPExcel_NamedRange

Definition at line 194 of file NamedRange.php.

{
$this->_localOnly = $value;
$this->_scope = $value ? $this->_worksheet : null;
return $this;
}
PHPExcel_NamedRange::setName (   $value = null)

Set name.

Parameters
string$value
Returns
PHPExcel_NamedRange

Definition at line 113 of file NamedRange.php.

References $_name, and PHPExcel_ReferenceHelper\getInstance().

{
if (!is_null($value)) {
// Old title
$oldTitle = $this->_name;
// Re-attach
if (!is_null($this->_worksheet)) {
$this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet);
}
$this->_name = $value;
if (!is_null($this->_worksheet)) {
$this->_worksheet->getParent()->addNamedRange($this);
}
// New title
$newTitle = $this->_name;
PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle);
}
return $this;
}

+ Here is the call graph for this function:

PHPExcel_NamedRange::setRange (   $value = null)

Set range.

Parameters
string$value
Returns
PHPExcel_NamedRange

Definition at line 172 of file NamedRange.php.

{
if (!is_null($value)) {
$this->_range = $value;
}
return $this;
}
PHPExcel_NamedRange::setScope ( PHPExcel_Worksheet  $value = null)

Set scope.

Parameters
PHPExcel_Worksheet | null$value
Returns
PHPExcel_NamedRange

Definition at line 215 of file NamedRange.php.

{
$this->_scope = $value;
$this->_localOnly = ($value == null) ? false : true;
return $this;
}
PHPExcel_NamedRange::setWorksheet ( PHPExcel_Worksheet  $value = null)

Set worksheet.

Parameters
PHPExcel_Worksheet$value
Returns
PHPExcel_NamedRange

Definition at line 150 of file NamedRange.php.

{
if (!is_null($value)) {
$this->_worksheet = $value;
}
return $this;
}

Field Documentation

PHPExcel_NamedRange::$_localOnly
private

Definition at line 64 of file NamedRange.php.

Referenced by getLocalOnly().

PHPExcel_NamedRange::$_name
private

Definition at line 43 of file NamedRange.php.

Referenced by getName(), and setName().

PHPExcel_NamedRange::$_range
private

Definition at line 57 of file NamedRange.php.

Referenced by getRange().

PHPExcel_NamedRange::$_scope
private

Definition at line 71 of file NamedRange.php.

Referenced by getScope().

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: