ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel Class Reference
+ Collaboration diagram for PHPExcel:

Public Member Functions

 __construct ()
 Create a new PHPExcel with one Worksheet.
 disconnectWorksheets ()
 getProperties ()
 Get properties.
 setProperties (PHPExcel_DocumentProperties $pValue)
 Set properties.
 getSecurity ()
 Get security.
 setSecurity (PHPExcel_DocumentSecurity $pValue)
 Set security.
 getActiveSheet ()
 Get active sheet.
 createSheet ($iSheetIndex=null)
 Create sheet and add it to this workbook.
 addSheet (PHPExcel_Worksheet $pSheet=null, $iSheetIndex=null)
 Add sheet.
 removeSheetByIndex ($pIndex=0)
 Remove sheet by index.
 getSheet ($pIndex=0)
 Get sheet by index.
 getAllSheets ()
 Get all sheets.
 getSheetByName ($pName= '')
 Get sheet by name.
 getIndex (PHPExcel_Worksheet $pSheet)
 Get index for sheet.
 setIndexByName ($sheetName, $newIndex)
 Set index for sheet by sheet name.
 getSheetCount ()
 Get sheet count.
 getActiveSheetIndex ()
 Get active sheet index.
 setActiveSheetIndex ($pIndex=0)
 Set active sheet index.
 setActiveSheetIndexByName ($pValue= '')
 Set active sheet index by name.
 getSheetNames ()
 Get sheet names.
 addExternalSheet (PHPExcel_Worksheet $pSheet, $iSheetIndex=null)
 Add external sheet.
 getNamedRanges ()
 Get named ranges.
 addNamedRange (PHPExcel_NamedRange $namedRange)
 Add named range.
 getNamedRange ($namedRange, PHPExcel_Worksheet $pSheet=null)
 Get named range.
 removeNamedRange ($namedRange, PHPExcel_Worksheet $pSheet=null)
 Remove named range.
 getWorksheetIterator ()
 Get worksheet iterator.
 copy ()
 Copy workbook (!= clone!)
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.
 getCellXfCollection ()
 Get the workbook collection of cellXfs.
 getCellXfByIndex ($pIndex=0)
 Get cellXf by index.
 getCellXfByHashCode ($pValue= '')
 Get cellXf by hash code.
 getDefaultStyle ()
 Get default style.
 addCellXf (PHPExcel_Style $style)
 Add a cellXf to the workbook.
 removeCellXfByIndex ($pIndex=0)
 Remove cellXf by index.
 getCellXfSupervisor ()
 Get the cellXf supervisor.
 getCellStyleXfCollection ()
 Get the workbook collection of cellStyleXfs.
 getCellStyleXfByIndex ($pIndex=0)
 Get cellStyleXf by index.
 getCellStyleXfByHashCode ($pValue= '')
 Get cellStyleXf by hash code.
 addCellStyleXf (PHPExcel_Style $pStyle)
 Add a cellStyleXf to the workbook.
 removeCellStyleXfByIndex ($pIndex=0)
 Remove cellStyleXf by index.
 garbageCollect ()
 Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells and columns in the workbook.

Private Attributes

 $_properties
 $_security
 $_workSheetCollection = array()
 $_activeSheetIndex = 0
 $_namedRanges = array()
 $_cellXfSupervisor
 $_cellXfCollection = array()
 $_cellStyleXfCollection = array()

Detailed Description

Definition at line 43 of file PHPExcel.php.

Constructor & Destructor Documentation

PHPExcel::__construct ( )

Create a new PHPExcel with one Worksheet.

Definition at line 104 of file PHPExcel.php.

References addCellStyleXf(), and addCellXf().

{
// Initialise worksheet collection and add one worksheet
$this->_workSheetCollection = array();
$this->_workSheetCollection[] = new PHPExcel_Worksheet($this);
$this->_activeSheetIndex = 0;
// Create document properties
$this->_properties = new PHPExcel_DocumentProperties();
// Create document security
$this->_security = new PHPExcel_DocumentSecurity();
// Set named ranges
$this->_namedRanges = array();
// Create the cellXf supervisor
$this->_cellXfSupervisor = new PHPExcel_Style(true);
$this->_cellXfSupervisor->bindParent($this);
// Create the default style
}

+ Here is the call graph for this function:

Member Function Documentation

PHPExcel::__clone ( )

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

Definition at line 538 of file PHPExcel.php.

{
foreach($this as $key => $val) {
if (is_object($val) || (is_array($val))) {
$this->{$key} = unserialize(serialize($val));
}
}
}
PHPExcel::addCellStyleXf ( PHPExcel_Style  $pStyle)

Add a cellStyleXf to the workbook.

Parameters
PHPExcel_Style$pStyle

Definition at line 691 of file PHPExcel.php.

References PHPExcel_Style\setIndex().

Referenced by __construct().

{
$this->_cellStyleXfCollection[] = $pStyle;
$pStyle->setIndex(count($this->_cellStyleXfCollection) - 1);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel::addCellXf ( PHPExcel_Style  $style)

Add a cellXf to the workbook.

Parameters
PHPExcel_Style

Definition at line 602 of file PHPExcel.php.

References PHPExcel_Style\setIndex().

Referenced by __construct(), and addExternalSheet().

{
$this->_cellXfCollection[] = $style;
$style->setIndex(count($this->_cellXfCollection) - 1);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel::addExternalSheet ( PHPExcel_Worksheet  $pSheet,
  $iSheetIndex = null 
)

Add external sheet.

Parameters
PHPExcel_Worksheet$pSheetExternal sheet to add
int | null$iSheetIndexIndex where sheet should go (0,1,..., or null for last)
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 413 of file PHPExcel.php.

References addCellXf(), addSheet(), PHPExcel_Worksheet\getCell(), PHPExcel_Worksheet\getCellCollection(), PHPExcel_Worksheet\getParent(), getSheetByName(), PHPExcel_Worksheet\getTitle(), and PHPExcel_Worksheet\rebindParent().

{
if (!is_null($this->getSheetByName($pSheet->getTitle()))) {
throw new Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first.");
}
// count how many cellXfs there are in this workbook currently, we will need this below
$countCellXfs = count($this->_cellXfCollection);
// copy all the shared cellXfs from the external workbook and append them to the current
foreach ($pSheet->getParent()->getCellXfCollection() as $cellXf) {
$this->addCellXf(clone $cellXf);
}
// move sheet to this workbook
$pSheet->rebindParent($this);
// update the cellXfs
foreach ($pSheet->getCellCollection(false) as $cellID) {
$cell = $pSheet->getCell($cellID);
$cell->setXfIndex( $cell->getXfIndex() + $countCellXfs );
}
return $this->addSheet($pSheet, $iSheetIndex);
}

+ Here is the call graph for this function:

PHPExcel::addNamedRange ( PHPExcel_NamedRange  $namedRange)

Add named range.

Parameters
PHPExcel_NamedRange$namedRange
Returns
PHPExcel

Definition at line 453 of file PHPExcel.php.

References PHPExcel_NamedRange\getName(), and PHPExcel_NamedRange\getScope().

Referenced by PHPExcel_Worksheet\rebindParent().

{
if ($namedRange->getScope() == null) {
// global scope
$this->_namedRanges[$namedRange->getName()] = $namedRange;
} else {
// local scope
$this->_namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel::addSheet ( PHPExcel_Worksheet  $pSheet = null,
  $iSheetIndex = null 
)

Add sheet.

Parameters
PHPExcel_Worksheet$pSheet
int | null$iSheetIndexIndex where sheet should go (0,1,..., or null for last)
Returns
PHPExcel_Worksheet
Exceptions
Exception

Definition at line 209 of file PHPExcel.php.

References $_activeSheetIndex.

Referenced by addExternalSheet(), and createSheet().

{
if(is_null($iSheetIndex))
{
$this->_workSheetCollection[] = $pSheet;
}
else
{
// Insert the sheet at the requested index
array_splice(
$this->_workSheetCollection,
$iSheetIndex,
0,
array($pSheet)
);
// Adjust active sheet index if necessary
if ($this->_activeSheetIndex >= $iSheetIndex) {
}
}
return $pSheet;
}

+ Here is the caller graph for this function:

PHPExcel::copy ( )

Copy workbook (!= clone!)

Returns
PHPExcel

Definition at line 523 of file PHPExcel.php.

{
$copied = clone $this;
$worksheetCount = count($this->_workSheetCollection);
for ($i = 0; $i < $worksheetCount; ++$i) {
$this->_workSheetCollection[$i] = $this->_workSheetCollection[$i]->copy();
$this->_workSheetCollection[$i]->rebindParent($this);
}
return $copied;
}
PHPExcel::createSheet (   $iSheetIndex = null)

Create sheet and add it to this workbook.

Returns
PHPExcel_Worksheet

Definition at line 194 of file PHPExcel.php.

References addSheet().

Referenced by PHPExcel_Reader_SYLK\loadIntoExisting(), PHPExcel_Reader_CSV\loadIntoExisting(), PHPExcel_Reader_OOCalc\loadIntoExisting(), and PHPExcel_Reader_Excel2003XML\loadIntoExisting().

{
$newSheet = new PHPExcel_Worksheet($this);
$this->addSheet($newSheet, $iSheetIndex);
return $newSheet;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel::disconnectWorksheets ( )

Definition at line 130 of file PHPExcel.php.

{
foreach($this->_workSheetCollection as $k => &$worksheet) {
$worksheet->disconnectCells();
$this->_workSheetCollection[$k] = null;
}
unset($worksheet);
$this->_workSheetCollection = array();
}
PHPExcel::garbageCollect ( )

Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells and columns in the workbook.

Definition at line 716 of file PHPExcel.php.

References getWorksheetIterator().

{
// how many references are there to each cellXf ?
$countReferencesCellXf = array();
foreach ($this->_cellXfCollection as $index => $cellXf) {
$countReferencesCellXf[$index] = 0;
}
foreach ($this->getWorksheetIterator() as $sheet) {
// from cells
foreach ($sheet->getCellCollection(false) as $cellID) {
$cell = $sheet->getCell($cellID);
++$countReferencesCellXf[$cell->getXfIndex()];
}
// from row dimensions
foreach ($sheet->getRowDimensions() as $rowDimension) {
if ($rowDimension->getXfIndex() !== null) {
++$countReferencesCellXf[$rowDimension->getXfIndex()];
}
}
// from column dimensions
foreach ($sheet->getColumnDimensions() as $columnDimension) {
++$countReferencesCellXf[$columnDimension->getXfIndex()];
}
}
// remove cellXfs without references and create mapping so we can update xfIndex
// for all cells and columns
$countNeededCellXfs = 0;
foreach ($this->_cellXfCollection as $index => $cellXf) {
if ($countReferencesCellXf[$index] > 0 || $index == 0) { // we must never remove the first cellXf
++$countNeededCellXfs;
} else {
unset($this->_cellXfCollection[$index]);
}
$map[$index] = $countNeededCellXfs - 1;
}
$this->_cellXfCollection = array_values($this->_cellXfCollection);
// update the index for all cellXfs
foreach ($this->_cellXfCollection as $i => $cellXf) {
$cellXf->setIndex($i);
}
// make sure there is always at least one cellXf (there should be)
if (count($this->_cellXfCollection) == 0) {
$this->_cellXfCollection[] = new PHPExcel_Style();
}
// update the xfIndex for all cells, row dimensions, column dimensions
foreach ($this->getWorksheetIterator() as $sheet) {
// for all cells
foreach ($sheet->getCellCollection(false) as $cellID) {
$cell = $sheet->getCell($cellID);
$cell->setXfIndex( $map[$cell->getXfIndex()] );
}
// for all row dimensions
foreach ($sheet->getRowDimensions() as $rowDimension) {
if ($rowDimension->getXfIndex() !== null) {
$rowDimension->setXfIndex( $map[$rowDimension->getXfIndex()] );
}
}
// for all column dimensions
foreach ($sheet->getColumnDimensions() as $columnDimension) {
$columnDimension->setXfIndex( $map[$columnDimension->getXfIndex()] );
}
}
// also do garbage collection for all the sheets
foreach ($this->getWorksheetIterator() as $sheet) {
$sheet->garbageCollect();
}
}

+ Here is the call graph for this function:

PHPExcel::getActiveSheet ( )

Get active sheet.

Returns
PHPExcel_Worksheet

Definition at line 184 of file PHPExcel.php.

References $_activeSheetIndex.

Referenced by PHPExcel_Reader_SYLK\loadIntoExisting(), PHPExcel_Reader_CSV\loadIntoExisting(), PHPExcel_Reader_OOCalc\loadIntoExisting(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), and setActiveSheetIndex().

{
return $this->_workSheetCollection[$this->_activeSheetIndex];
}

+ Here is the caller graph for this function:

PHPExcel::getActiveSheetIndex ( )

Get active sheet index.

Returns
int Active sheet index

Definition at line 350 of file PHPExcel.php.

References $_activeSheetIndex.

PHPExcel::getAllSheets ( )

Get all sheets.

Returns
PHPExcel_Worksheet[]

Definition at line 270 of file PHPExcel.php.

References $_workSheetCollection.

PHPExcel::getCellStyleXfByHashCode (   $pValue = '')

Get cellStyleXf by hash code.

Parameters
string$pValue
Returns
PHPExcel_Style|false

Definition at line 676 of file PHPExcel.php.

{
foreach ($this->_cellXfStyleCollection as $cellStyleXf) {
if ($cellStyleXf->getHashCode() == $pValue) {
return $cellStyleXf;
}
}
return false;
}
PHPExcel::getCellStyleXfByIndex (   $pIndex = 0)

Get cellStyleXf by index.

Parameters
int$pIndex
Returns
PHPExcel_Style

Definition at line 665 of file PHPExcel.php.

{
return $this->_cellStyleXfCollection[$pIndex];
}
PHPExcel::getCellStyleXfCollection ( )

Get the workbook collection of cellStyleXfs.

Returns
PHPExcel_Style[]

Definition at line 654 of file PHPExcel.php.

References $_cellStyleXfCollection.

PHPExcel::getCellXfByHashCode (   $pValue = '')

Get cellXf by hash code.

Parameters
string$pValue
Returns
PHPExcel_Style|false

Definition at line 573 of file PHPExcel.php.

{
foreach ($this->_cellXfCollection as $cellXf) {
if ($cellXf->getHashCode() == $pValue) {
return $cellXf;
}
}
return false;
}
PHPExcel::getCellXfByIndex (   $pIndex = 0)

Get cellXf by index.

Parameters
int$index
Returns
PHPExcel_Style

Definition at line 562 of file PHPExcel.php.

{
return $this->_cellXfCollection[$pIndex];
}
PHPExcel::getCellXfCollection ( )

Get the workbook collection of cellXfs.

Returns
PHPExcel_Style[]

Definition at line 551 of file PHPExcel.php.

References $_cellXfCollection.

PHPExcel::getCellXfSupervisor ( )

Get the cellXf supervisor.

Returns
PHPExcel_Style

Definition at line 644 of file PHPExcel.php.

References $_cellXfSupervisor.

PHPExcel::getDefaultStyle ( )

Get default style.

Returns
PHPExcel_Style
Exceptions
Exception

Definition at line 589 of file PHPExcel.php.

Referenced by PHPExcel_Writer_HTML\__construct().

{
if (isset($this->_cellXfCollection[0])) {
return $this->_cellXfCollection[0];
}
throw new Exception('No default style found for this workbook');
}

+ Here is the caller graph for this function:

PHPExcel::getIndex ( PHPExcel_Worksheet  $pSheet)

Get index for sheet.

Parameters
PHPExcel_Worksheet$pSheet
Returns
Sheet index
Exceptions
Exception

Definition at line 301 of file PHPExcel.php.

References PHPExcel_Worksheet\getHashCode().

Referenced by setIndexByName().

{
foreach ($this->_workSheetCollection as $key => $value) {
if ($value->getHashCode() == $pSheet->getHashCode()) {
return $key;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel::getNamedRange (   $namedRange,
PHPExcel_Worksheet  $pSheet = null 
)

Get named range.

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

Definition at line 471 of file PHPExcel.php.

{
$returnValue = null;
if ($namedRange != '' && !is_null($namedRange)) {
// first look for global defined name
if (isset($this->_namedRanges[$namedRange])) {
$returnValue = $this->_namedRanges[$namedRange];
}
// then look for local defined name (has priority over global defined name if both names exist)
if (!is_null($pSheet) && isset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
$returnValue = $this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange];
}
}
return $returnValue;
}
PHPExcel::getNamedRanges ( )

Get named ranges.

Returns
PHPExcel_NamedRange[]

Definition at line 443 of file PHPExcel.php.

References $_namedRanges.

Referenced by PHPExcel_Writer_Excel2007_Workbook\_writeNamedRanges().

{
}

+ Here is the caller graph for this function:

PHPExcel::getProperties ( )

Get properties.

Returns
PHPExcel_DocumentProperties

Definition at line 144 of file PHPExcel.php.

References $_properties.

Referenced by PHPExcel_Reader_OOCalc\loadIntoExisting(), PHPExcel_Reader_Gnumeric\loadIntoExisting(), and PHPExcel_Reader_Excel2003XML\loadIntoExisting().

{
}

+ Here is the caller graph for this function:

PHPExcel::getSecurity ( )

Get security.

Returns
PHPExcel_DocumentSecurity

Definition at line 164 of file PHPExcel.php.

References $_security.

{
}
PHPExcel::getSheet (   $pIndex = 0)

Get sheet by index.

Parameters
int$pIndexSheet index
Returns
PHPExcel_Worksheet
Exceptions
Exception

Definition at line 256 of file PHPExcel.php.

Referenced by getSheetNames().

{
if ($pIndex > count($this->_workSheetCollection) - 1) {
throw new Exception("Sheet index is out of bounds.");
} else {
return $this->_workSheetCollection[$pIndex];
}
}

+ Here is the caller graph for this function:

PHPExcel::getSheetByName (   $pName = '')

Get sheet by name.

Parameters
string$pNameSheet name
Returns
PHPExcel_Worksheet
Exceptions
Exception

Definition at line 282 of file PHPExcel.php.

Referenced by addExternalSheet(), setActiveSheetIndexByName(), and setIndexByName().

{
$worksheetCount = count($this->_workSheetCollection);
for ($i = 0; $i < $worksheetCount; ++$i) {
if ($this->_workSheetCollection[$i]->getTitle() == $pName) {
return $this->_workSheetCollection[$i];
}
}
return null;
}

+ Here is the caller graph for this function:

PHPExcel::getSheetCount ( )

Get sheet count.

Returns
int

Definition at line 340 of file PHPExcel.php.

Referenced by getSheetNames(), PHPExcel_Reader_SYLK\loadIntoExisting(), and PHPExcel_Reader_CSV\loadIntoExisting().

{
return count($this->_workSheetCollection);
}

+ Here is the caller graph for this function:

PHPExcel::getSheetNames ( )

Get sheet names.

Returns
string[]

Definition at line 394 of file PHPExcel.php.

References getSheet(), and getSheetCount().

{
$returnValue = array();
$worksheetCount = $this->getSheetCount();
for ($i = 0; $i < $worksheetCount; ++$i) {
array_push($returnValue, $this->getSheet($i)->getTitle());
}
return $returnValue;
}

+ Here is the call graph for this function:

PHPExcel::getWorksheetIterator ( )

Get worksheet iterator.

Returns
PHPExcel_WorksheetIterator

Definition at line 514 of file PHPExcel.php.

Referenced by garbageCollect(), and PHPExcel_ReferenceHelper\updateNamedFormulas().

{
return new PHPExcel_WorksheetIterator($this);
}

+ Here is the caller graph for this function:

PHPExcel::removeCellStyleXfByIndex (   $pIndex = 0)

Remove cellStyleXf by index.

Parameters
int$pIndex
Exceptions
Exception

Definition at line 703 of file PHPExcel.php.

{
if ($pIndex > count($this->_cellStyleXfCollection) - 1) {
throw new Exception("CellStyleXf index is out of bounds.");
} else {
array_splice($this->_cellStyleXfCollection, $pIndex, 1);
}
}
PHPExcel::removeCellXfByIndex (   $pIndex = 0)

Remove cellXf by index.

It is ensured that all cells get their xf index updated.

Parameters
int$pIndexIndex to cellXf
Exceptions
Exception

Definition at line 614 of file PHPExcel.php.

{
if ($pIndex > count($this->_cellXfCollection) - 1) {
throw new Exception("CellXf index is out of bounds.");
} else {
// first remove the cellXf
array_splice($this->_cellXfCollection, $pIndex, 1);
// then update cellXf indexes for cells
foreach ($this->_workSheetCollection as $worksheet) {
foreach ($worksheet->getCellCollection(false) as $cellID) {
$cell = $worksheet->getCell($cellID);
$xfIndex = $cell->getXfIndex();
if ($xfIndex > $pIndex ) {
// decrease xf index by 1
$cell->setXfIndex($xfIndex - 1);
} else if ($xfIndex == $pIndex) {
// set to default xf index 0
$cell->setXfIndex(0);
}
}
}
}
}
PHPExcel::removeNamedRange (   $namedRange,
PHPExcel_Worksheet  $pSheet = null 
)

Remove named range.

Parameters
string$namedRange
PHPExcel_Worksheet | null$pSheet,.Scope. Use null for global scope.
Returns
PHPExcel

Definition at line 496 of file PHPExcel.php.

{
if (is_null($pSheet)) {
if (isset($this->_namedRanges[$namedRange])) {
unset($this->_namedRanges[$namedRange]);
}
} else {
if (isset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
unset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange]);
}
}
return $this;
}
PHPExcel::removeSheetByIndex (   $pIndex = 0)

Remove sheet by index.

Parameters
int$pIndexActive sheet index
Exceptions
Exception

Definition at line 240 of file PHPExcel.php.

Referenced by PHPExcel_Reader_Excel2007\load(), and PHPExcel_Reader_Excel5\load().

{
if ($pIndex > count($this->_workSheetCollection) - 1) {
throw new Exception("Sheet index is out of bounds.");
} else {
array_splice($this->_workSheetCollection, $pIndex, 1);
}
}

+ Here is the caller graph for this function:

PHPExcel::setActiveSheetIndex (   $pIndex = 0)

Set active sheet index.

Parameters
int$pIndexActive sheet index
Exceptions
Exception
Returns
PHPExcel_Worksheet

Definition at line 362 of file PHPExcel.php.

References getActiveSheet().

Referenced by PHPExcel_Reader_SYLK\loadIntoExisting(), PHPExcel_Reader_CSV\loadIntoExisting(), PHPExcel_Reader_OOCalc\loadIntoExisting(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), and setActiveSheetIndexByName().

{
if ($pIndex > count($this->_workSheetCollection) - 1) {
throw new Exception("Active sheet index is out of bounds.");
} else {
$this->_activeSheetIndex = $pIndex;
}
return $this->getActiveSheet();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel::setActiveSheetIndexByName (   $pValue = '')

Set active sheet index by name.

Parameters
string$pValueSheet title
Returns
PHPExcel_Worksheet
Exceptions
Exception

Definition at line 379 of file PHPExcel.php.

References getSheetByName(), and setActiveSheetIndex().

{
if (($worksheet = $this->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) {
$this->setActiveSheetIndex($worksheet->getParent()->getIndex($worksheet));
return $worksheet;
}
throw new Exception('Workbook does not contain sheet:' . $pValue);
}

+ Here is the call graph for this function:

PHPExcel::setIndexByName (   $sheetName,
  $newIndex 
)

Set index for sheet by sheet name.

Parameters
string$sheetNameSheet name to modify index for
int$newIndexNew index for the sheet
Returns
New sheet index
Exceptions
Exception

Definition at line 318 of file PHPExcel.php.

References getIndex(), and getSheetByName().

{
$oldIndex = $this->getIndex($this->getSheetByName($sheetName));
$pSheet = array_splice(
$this->_workSheetCollection,
$oldIndex,
1
);
array_splice(
$this->_workSheetCollection,
$newIndex,
0,
$pSheet
);
return $newIndex;
}

+ Here is the call graph for this function:

PHPExcel::setProperties ( PHPExcel_DocumentProperties  $pValue)

Set properties.

Parameters
PHPExcel_DocumentProperties$pValue

Definition at line 154 of file PHPExcel.php.

{
$this->_properties = $pValue;
}
PHPExcel::setSecurity ( PHPExcel_DocumentSecurity  $pValue)

Set security.

Parameters
PHPExcel_DocumentSecurity$pValue

Definition at line 174 of file PHPExcel.php.

{
$this->_security = $pValue;
}

Field Documentation

PHPExcel::$_activeSheetIndex = 0
private

Definition at line 71 of file PHPExcel.php.

Referenced by addSheet(), getActiveSheet(), and getActiveSheetIndex().

PHPExcel::$_cellStyleXfCollection = array()
private

Definition at line 99 of file PHPExcel.php.

Referenced by getCellStyleXfCollection().

PHPExcel::$_cellXfCollection = array()
private

Definition at line 92 of file PHPExcel.php.

Referenced by getCellXfCollection().

PHPExcel::$_cellXfSupervisor
private

Definition at line 85 of file PHPExcel.php.

Referenced by getCellXfSupervisor().

PHPExcel::$_namedRanges = array()
private

Definition at line 78 of file PHPExcel.php.

Referenced by getNamedRanges().

PHPExcel::$_properties
private

Definition at line 50 of file PHPExcel.php.

Referenced by getProperties().

PHPExcel::$_security
private

Definition at line 57 of file PHPExcel.php.

Referenced by getSecurity().

PHPExcel::$_workSheetCollection = array()
private

Definition at line 64 of file PHPExcel.php.

Referenced by getAllSheets().


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