PHPExcel
[ class tree: PHPExcel ] [ index: PHPExcel ] [ all elements ]

Source for file PHPExcel.php

Documentation is available at PHPExcel.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2009 PHPExcel
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPExcel
  22.  * @package    PHPExcel
  23.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.7.0, 2009-08-10
  26.  */
  27.  
  28.  
  29. /** PHPExcel root directory */
  30. if (!defined('PHPEXCEL_ROOT')) {
  31.     define('PHPEXCEL_ROOT'dirname(__FILE__'/');
  32. }
  33.  
  34. /** PHPExcel_Cell */
  35. require_once PHPEXCEL_ROOT 'PHPExcel/Cell.php';
  36.  
  37. /** PHPExcel_DocumentProperties */
  38. require_once PHPEXCEL_ROOT 'PHPExcel/DocumentProperties.php';
  39.  
  40. /** PHPExcel_DocumentSecurity */
  41. require_once PHPEXCEL_ROOT 'PHPExcel/DocumentSecurity.php';
  42.  
  43. /** PHPExcel_Worksheet */
  44. require_once PHPEXCEL_ROOT 'PHPExcel/Worksheet.php';
  45.  
  46. /** PHPExcel_Shared_ZipStreamWrapper */
  47. require_once PHPEXCEL_ROOT 'PHPExcel/Shared/ZipStreamWrapper.php';
  48.  
  49. /** PHPExcel_NamedRange */
  50. require_once PHPEXCEL_ROOT 'PHPExcel/NamedRange.php';
  51.  
  52. /** PHPExcel_WorksheetIterator */
  53. require_once PHPEXCEL_ROOT 'PHPExcel/WorksheetIterator.php';
  54.  
  55.  
  56. /**
  57.  * PHPExcel
  58.  *
  59.  * @category   PHPExcel
  60.  * @package    PHPExcel
  61.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  62.  */
  63. class PHPExcel
  64. {
  65.     /**
  66.      * Document properties
  67.      *
  68.      * @var PHPExcel_DocumentProperties 
  69.      */
  70.     private $_properties;
  71.  
  72.     /**
  73.      * Document security
  74.      *
  75.      * @var PHPExcel_DocumentSecurity 
  76.      */
  77.     private $_security;
  78.  
  79.     /**
  80.      * Collection of Worksheet objects
  81.      *
  82.      * @var PHPExcel_Worksheet[] 
  83.      */
  84.     private $_workSheetCollection = array();
  85.  
  86.     /**
  87.      * Active sheet index
  88.      *
  89.      * @var int 
  90.      */
  91.     private $_activeSheetIndex = 0;
  92.  
  93.     /**
  94.      * Named ranges
  95.      *
  96.      * @var PHPExcel_NamedRange[] 
  97.      */
  98.     private $_namedRanges = array();
  99.  
  100.     /**
  101.      * CellXf supervisor
  102.      *
  103.      * @var PHPExcel_Style 
  104.      */
  105.     private $_cellXfSupervisor;
  106.  
  107.     /**
  108.      * CellXf collection
  109.      *
  110.      * @var PHPExcel_Style[] 
  111.      */
  112.     private $_cellXfCollection = array();
  113.  
  114.     /**
  115.      * CellStyleXf collection
  116.      *
  117.      * @var PHPExcel_Style[] 
  118.      */
  119.     private $_cellStyleXfCollection = array();
  120.  
  121.     /**
  122.      * Create a new PHPExcel with one Worksheet
  123.      */
  124.     public function __construct()
  125.     {
  126.         // Initialise worksheet collection and add one worksheet
  127.         $this->_workSheetCollection = array();
  128.         $this->_workSheetCollection[new PHPExcel_Worksheet($this);
  129.         $this->_activeSheetIndex = 0;
  130.  
  131.         // Create document properties
  132.         $this->_properties = new PHPExcel_DocumentProperties();
  133.  
  134.         // Create document security
  135.         $this->_security = new PHPExcel_DocumentSecurity();
  136.  
  137.         // Set named ranges
  138.         $this->_namedRanges = array();
  139.  
  140.         // Create the cellXf supervisor
  141.         $this->_cellXfSupervisor = new PHPExcel_Style(true);
  142.         $this->_cellXfSupervisor->bindParent($this);
  143.  
  144.         // Create the default style
  145.         $this->addCellXf(new PHPExcel_Style);
  146.         $this->addCellStyleXf(new PHPExcel_Style);
  147.     }
  148.  
  149.     /**
  150.      * Get properties
  151.      *
  152.      * @return PHPExcel_DocumentProperties 
  153.      */
  154.     public function getProperties()
  155.     {
  156.         return $this->_properties;
  157.     }
  158.  
  159.     /**
  160.      * Set properties
  161.      *
  162.      * @param PHPExcel_DocumentProperties    $pValue 
  163.      */
  164.     public function setProperties(PHPExcel_DocumentProperties $pValue)
  165.     {
  166.         $this->_properties = $pValue;
  167.     }
  168.  
  169.     /**
  170.      * Get security
  171.      *
  172.      * @return PHPExcel_DocumentSecurity 
  173.      */
  174.     public function getSecurity()
  175.     {
  176.         return $this->_security;
  177.     }
  178.  
  179.     /**
  180.      * Set security
  181.      *
  182.      * @param PHPExcel_DocumentSecurity    $pValue 
  183.      */
  184.     public function setSecurity(PHPExcel_DocumentSecurity $pValue)
  185.     {
  186.         $this->_security = $pValue;
  187.     }
  188.  
  189.     /**
  190.      * Get active sheet
  191.      *
  192.      * @return PHPExcel_Worksheet 
  193.      */
  194.     public function getActiveSheet()
  195.     {
  196.         return $this->_workSheetCollection[$this->_activeSheetIndex];
  197.     }
  198.  
  199.     /**
  200.      * Create sheet and add it to this workbook
  201.      *
  202.      * @return PHPExcel_Worksheet 
  203.      */
  204.     public function createSheet($iSheetIndex null)
  205.     {
  206.         $newSheet new PHPExcel_Worksheet($this);
  207.         $this->addSheet($newSheet$iSheetIndex);
  208.         return $newSheet;
  209.     }
  210.  
  211.     /**
  212.      * Add sheet
  213.      *
  214.      * @param PHPExcel_Worksheet $pSheet 
  215.      * @throws Exception
  216.      */
  217.     public function addSheet(PHPExcel_Worksheet $pSheet null$iSheetIndex null)
  218.     {
  219.         if(is_null($iSheetIndex))
  220.         {
  221.             $this->_workSheetCollection[$pSheet;
  222.         }
  223.         else
  224.         {
  225.             // Insert the sheet at the requested index
  226.             array_splice(
  227.                 $this->_workSheetCollection,
  228.                 $iSheetIndex,
  229.                 0,
  230.                 array($pSheet)
  231.                 );
  232.         }
  233.     }
  234.  
  235.     /**
  236.      * Remove sheet by index
  237.      *
  238.      * @param int $pIndex Active sheet index
  239.      * @throws Exception
  240.      */
  241.     public function removeSheetByIndex($pIndex 0)
  242.     {
  243.         if ($pIndex count($this->_workSheetCollection1{
  244.             throw new Exception("Sheet index is out of bounds.");
  245.         else {
  246.             array_splice($this->_workSheetCollection$pIndex1);
  247.         }
  248.     }
  249.  
  250.     /**
  251.      * Get sheet by index
  252.      *
  253.      * @param int $pIndex Sheet index
  254.      * @return PHPExcel_Worksheet 
  255.      * @throws Exception
  256.      */
  257.     public function getSheet($pIndex 0)
  258.     {
  259.         if ($pIndex count($this->_workSheetCollection1{
  260.             throw new Exception("Sheet index is out of bounds.");
  261.         else {
  262.             return $this->_workSheetCollection[$pIndex];
  263.         }
  264.     }
  265.  
  266.     /**
  267.      * Get all sheets
  268.      *
  269.      * @return PHPExcel_Worksheet[] 
  270.      */
  271.     public function getAllSheets()
  272.     {
  273.         return $this->_workSheetCollection;
  274.     }
  275.  
  276.     /**
  277.      * Get sheet by name
  278.      *
  279.      * @param string $pName Sheet name
  280.      * @return PHPExcel_Worksheet 
  281.      * @throws Exception
  282.      */
  283.     public function getSheetByName($pName '')
  284.     {
  285.         $worksheetCount count($this->_workSheetCollection);
  286.         for ($i 0$i $worksheetCount++$i{
  287.             if ($this->_workSheetCollection[$i]->getTitle(== $pName{
  288.                 return $this->_workSheetCollection[$i];
  289.             }
  290.         }
  291.  
  292.         return null;
  293.     }
  294.  
  295.     /**
  296.      * Get index for sheet
  297.      *
  298.      * @param PHPExcel_Worksheet $pSheet 
  299.      * @return Sheet index
  300.      * @throws Exception
  301.      */
  302.     public function getIndex(PHPExcel_Worksheet $pSheet)
  303.     {
  304.         foreach ($this->_workSheetCollection as $key => $value{
  305.             if ($value->getHashCode(== $pSheet->getHashCode()) {
  306.                 return $key;
  307.             }
  308.         }
  309.     }
  310.  
  311.     /**
  312.      * Set index for sheet by sheet name.
  313.      *
  314.      * @param string $sheetName Sheet name to modify index for
  315.      * @param int $newIndex New index for the sheet
  316.      * @return New sheet index
  317.      * @throws Exception
  318.      */
  319.     public function setIndexByName($sheetName$newIndex)
  320.     {
  321.         $oldIndex $this->getIndex($this->getSheetByName($sheetName));
  322.         $pSheet array_splice(
  323.             $this->_workSheetCollection,
  324.             $oldIndex,
  325.             1
  326.             );
  327.         array_splice(
  328.             $this->_workSheetCollection,
  329.             $newIndex,
  330.             0,
  331.             $pSheet
  332.             );
  333.         return $newIndex;
  334.     }
  335.  
  336.     /**
  337.      * Get sheet count
  338.      *
  339.      * @return int 
  340.      */
  341.     public function getSheetCount()
  342.     {
  343.         return count($this->_workSheetCollection);
  344.     }
  345.  
  346.     /**
  347.      * Get active sheet index
  348.      *
  349.      * @return int Active sheet index
  350.      */
  351.     public function getActiveSheetIndex()
  352.     {
  353.         return $this->_activeSheetIndex;
  354.     }
  355.  
  356.     /**
  357.      * Set active sheet index
  358.      *
  359.      * @param int $pIndex Active sheet index
  360.      * @throws Exception
  361.      * @return PHPExcel_Worksheet 
  362.      */
  363.     public function setActiveSheetIndex($pIndex 0)
  364.     {
  365.         if ($pIndex count($this->_workSheetCollection1{
  366.             throw new Exception("Active sheet index is out of bounds.");
  367.         else {
  368.             $this->_activeSheetIndex = $pIndex;
  369.         }
  370.         return $this->getActiveSheet();
  371.     }
  372.  
  373.     /**
  374.      * Get sheet names
  375.      *
  376.      * @return string[] 
  377.      */
  378.     public function getSheetNames()
  379.     {
  380.         $returnValue array();
  381.         $worksheetCount $this->getSheetCount();
  382.         for ($i 0$i $worksheetCount++$i{
  383.             array_push($returnValue$this->getSheet($i)->getTitle());
  384.         }
  385.  
  386.         return $returnValue;
  387.     }
  388.  
  389.     /**
  390.      * Add external sheet
  391.      *
  392.      * @param PHPExcel_Worksheet $pSheet External sheet to add
  393.      * @throws Exception
  394.      * @return PHPExcel_Worksheet 
  395.      */
  396.     public function addExternalSheet(PHPExcel_Worksheet $pSheet{
  397.         if (!is_null($this->getSheetByName($pSheet->getTitle()))) {
  398.             throw new Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first.");
  399.         }
  400.  
  401.         // count how many cellXfs there are in this workbook currently, we will need this below
  402.         $countCellXfs count($this->_cellXfCollection);
  403.  
  404.         // copy all the shared cellXfs from the external workbook and append them to the current
  405.         foreach ($pSheet->getParent()->getCellXfCollection(as $cellXf{
  406.             $this->addCellXf(clone $cellXf);
  407.         }
  408.  
  409.         // move sheet to this workbook
  410.         $pSheet->rebindParent($this);
  411.  
  412.         // update the cellXfs
  413.         foreach ($pSheet->getCellCollection(falseas $cell{
  414.             $cell->setXfIndex$cell->getXfIndex($countCellXfs );
  415.         }
  416.  
  417.         return $this->addSheet($pSheet);
  418.     }
  419.  
  420.     /**
  421.      * Get named ranges
  422.      *
  423.      * @return PHPExcel_NamedRange[] 
  424.      */
  425.     public function getNamedRanges({
  426.         return $this->_namedRanges;
  427.     }
  428.  
  429.     /**
  430.      * Add named range
  431.      *
  432.      * @param PHPExcel_NamedRange $namedRange 
  433.      * @return PHPExcel 
  434.      */
  435.     public function addNamedRange(PHPExcel_NamedRange $namedRange{
  436.         $this->_namedRanges[$namedRange->getWorksheet()->getTitle().'!'.$namedRange->getName()$namedRange;
  437.         return true;
  438.     }
  439.  
  440.     /**
  441.      * Get named range
  442.      *
  443.      * @param string $namedRange 
  444.      */
  445.     public function getNamedRange($namedRangePHPExcel_Worksheet $pSheet null{
  446.         if ($namedRange != '' && !is_null($namedRange)) {
  447.             if (!is_null($pSheet)) {
  448.                 $key $pSheet->getTitle().'!'.$namedRange;
  449.                 if (isset($this->_namedRanges[$key])) {
  450.                     return $this->_namedRanges[$key];
  451.                 }
  452.             }
  453.             $returnCount 0;
  454.             foreach($this->_namedRanges as $_namedRange{
  455.                 if ($_namedRange->getName(== $namedRange{
  456.                     if ((!is_null($pSheet)) && ($_namedRange->getWorksheet()->getTitle(== $pSheet->getTitle())) {
  457.                         return $_namedRange;
  458.                     else {
  459.                         $returnCount++;
  460.                         $returnValue $_namedRange;
  461.                     }
  462.                 }
  463.             }
  464.             if ($returnCount == 1{
  465.                 return $returnValue;
  466.             }
  467.         }
  468.  
  469.         return null;
  470.     }
  471.  
  472.     /**
  473.      * Remove named range
  474.      *
  475.      * @param string $namedRange 
  476.      * @return PHPExcel 
  477.      */
  478.     public function removeNamedRange($namedRangePHPExcel_Worksheet $pSheet null{
  479.         if ($namedRange != '' && !is_null($namedRange)) {
  480.             if (!is_null($pSheet)) {
  481.                 $key $pSheet->getTitle().'!'.$namedRange;
  482.                 if (isset($this->_namedRanges[$key])) {
  483.                     unset($this->_namedRanges[$key]);
  484.                 }
  485.             }
  486.             foreach($this->_namedRanges as $_namedRange{
  487.                 if ($_namedRange->getName(== $namedRange{
  488.                     if ((!is_null($pSheet)) && ($_namedRange->getWorksheet()->getTitle(== $pSheet->getTitle())) {
  489.                         $key $pSheet->getTitle().'!'.$namedRange;
  490.                         if (isset($this->_namedRanges[$key])) {
  491.                             unset($this->_namedRanges[$key]);
  492.                         }
  493.                     }
  494.                 }
  495.             }
  496.         }
  497.         return $this;
  498.     }
  499.  
  500.     /**
  501.      * Get worksheet iterator
  502.      *
  503.      * @return PHPExcel_WorksheetIterator 
  504.      */
  505.     public function getWorksheetIterator({
  506.         return new PHPExcel_WorksheetIterator($this);
  507.     }
  508.  
  509.     /**
  510.      * Copy workbook (!= clone!)
  511.      *
  512.      * @return PHPExcel 
  513.      */
  514.     public function copy({
  515.         $copied clone $this;
  516.  
  517.         $worksheetCount count($this->_workSheetCollection);
  518.         for ($i 0$i $worksheetCount++$i{
  519.             $this->_workSheetCollection[$i$this->_workSheetCollection[$i]->copy();
  520.             $this->_workSheetCollection[$i]->rebindParent($this);
  521.         }
  522.  
  523.         return $copied;
  524.     }
  525.  
  526.     /**
  527.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  528.      */
  529.     public function __clone({
  530.         foreach($this as $key => $val{
  531.             if (is_object($val|| (is_array($val))) {
  532.                 $this->{$keyunserialize(serialize($val));
  533.             }
  534.         }
  535.     }
  536.  
  537.     /**
  538.      * Get the workbook collection of cellXfs
  539.      *
  540.      * @return PHPExcel_Style[] 
  541.      */
  542.     public function getCellXfCollection()
  543.     {
  544.         return $this->_cellXfCollection;
  545.     }
  546.  
  547.     /**
  548.      * Get cellXf by index
  549.      *
  550.      * @param int $index 
  551.      * @return PHPExcel_Style 
  552.      */
  553.     public function getCellXfByIndex($pIndex 0)
  554.     {
  555.         return $this->_cellXfCollection[$pIndex];
  556.     }
  557.  
  558.     /**
  559.      * Get cellXf by hash code
  560.      *
  561.      * @param string $pValue 
  562.      * @return PHPExcel_Style|false
  563.      */
  564.     public function getCellXfByHashCode($pValue '')
  565.     {
  566.         foreach ($this->_cellXfCollection as $cellXf{
  567.             if ($cellXf->getHashCode(== $pValue{
  568.                 return $cellXf;
  569.             }
  570.         }
  571.         return false;
  572.     }
  573.  
  574.     /**
  575.      * Get default style
  576.      *
  577.      * @return PHPExcel_Style 
  578.      * @throws Exception
  579.      */
  580.     public function getDefaultStyle()
  581.     {
  582.         if (isset($this->_cellXfCollection[0])) {
  583.             return $this->_cellXfCollection[0];
  584.         }
  585.         throw new Exception('No default style found for this workbook');
  586.     }
  587.  
  588.     /**
  589.      * Add a cellXf to the workbook
  590.      *
  591.      * @param PHPExcel_Style 
  592.      */
  593.     public function addCellXf(PHPExcel_Style $style)
  594.     {
  595.         $this->_cellXfCollection[$style;
  596.         $style->setIndex(count($this->_cellXfCollection1);
  597.     }
  598.  
  599.     /**
  600.      * Remove cellXf by index. It is ensured that all cells get their xf index updated.
  601.      *
  602.      * @param int $pIndex Index to cellXf
  603.      * @throws Exception
  604.      */
  605.     public function removeCellXfByIndex($pIndex 0)
  606.     {
  607.         if ($pIndex count($this->_cellXfCollection1{
  608.             throw new Exception("CellXf index is out of bounds.");
  609.         else {
  610.             // first remove the cellXf
  611.             array_splice($this->_cellXfCollection$pIndex1);
  612.  
  613.             // then update cellXf indexes for cells
  614.             foreach ($this->_workSheetCollection as $worksheet{
  615.                 foreach ($worksheet->getCellCollection(falseas $cell{
  616.                     $xfIndex $cell->getXfIndex();
  617.                     if ($xfIndex $pIndex {
  618.                         // decrease xf index by 1
  619.                         $cell->setXfIndex($xfIndex 1);
  620.                     else if ($xfIndex == $pIndex{
  621.                         // set to default xf index 0
  622.                         $cell->setXfIndex(0);
  623.                     }
  624.                 }
  625.             }
  626.         }
  627.     }
  628.  
  629.     /**
  630.      * Get the cellXf supervisor
  631.      *
  632.      * @return PHPExcel_Style 
  633.      */
  634.     public function getCellXfSupervisor()
  635.     {
  636.         return $this->_cellXfSupervisor;
  637.     }
  638.  
  639.     /**
  640.      * Get the workbook collection of cellStyleXfs
  641.      *
  642.      * @return PHPExcel_Style[] 
  643.      */
  644.     public function getCellStyleXfCollection()
  645.     {
  646.         return $this->_cellStyleXfCollection;
  647.     }
  648.  
  649.     /**
  650.      * Get cellStyleXf by index
  651.      *
  652.      * @param int $pIndex 
  653.      * @return PHPExcel_Style 
  654.      */
  655.     public function getCellStyleXfByIndex($pIndex 0)
  656.     {
  657.         return $this->_cellStyleXfCollection[$pIndex];
  658.     }
  659.  
  660.     /**
  661.      * Get cellStyleXf by hash code
  662.      *
  663.      * @param string $pValue 
  664.      * @return PHPExcel_Style|false
  665.      */
  666.     public function getCellStyleXfByHashCode($pValue '')
  667.     {
  668.         foreach ($this->_cellXfStyleCollection as $cellStyleXf{
  669.             if ($cellStyleXf->getHashCode(== $pValue{
  670.                 return $cellStyleXf;
  671.             }
  672.         }
  673.         return false;
  674.     }
  675.  
  676.     /**
  677.      * Add a cellStyleXf to the workbook
  678.      *
  679.      * @param PHPExcel_Style $pStyle 
  680.      */
  681.     public function addCellStyleXf(PHPExcel_Style $pStyle)
  682.     {
  683.         $this->_cellStyleXfCollection[$pStyle;
  684.         $pStyle->setIndex(count($this->_cellStyleXfCollection1);
  685.     }
  686.  
  687.     /**
  688.      * Remove cellStyleXf by index
  689.      *
  690.      * @param int $pIndex 
  691.      * @throws Exception
  692.      */
  693.     public function removeCellStyleXfByIndex($pIndex 0)
  694.     {
  695.         if ($pIndex count($this->_cellStyleXfCollection1{
  696.             throw new Exception("CellStyleXf index is out of bounds.");
  697.         else {
  698.             array_splice($this->_cellStyleXfCollection$pIndex1);
  699.         }
  700.     }
  701.  
  702.     /**
  703.      * Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells in the workbook
  704.      */
  705.     public function garbageCollect()
  706.     {
  707.         // how many references are there to each cellXf ?
  708.         $countReferencesCellXf array();
  709.         foreach ($this->_cellXfCollection as $index => $cellXf{
  710.             $countReferencesCellXf[$index0;
  711.         }
  712.  
  713.         foreach ($this->getWorksheetIterator(as $sheet{
  714.             foreach ($sheet->getCellCollection(falseas $cell{
  715.                 ++$countReferencesCellXf[$cell->getXfIndex()];
  716.             }
  717.         }
  718.  
  719.         // remove those cellXfs that have zero references and create mapping so we can update xfIndex for all cells
  720.         $countNeededCellXfs 0;
  721.         foreach ($this->_cellXfCollection as $index => $cellXf{
  722.             if ($countReferencesCellXf[$index|| $index == 0// we must never remove the first cellXf
  723.                 ++$countNeededCellXfs;
  724.             else {
  725.                 unset($this->_cellXfCollection[$index]);
  726.             }
  727.             $map[$index$countNeededCellXfs 1;
  728.         }
  729.         $this->_cellXfCollection array_values($this->_cellXfCollection);
  730.  
  731.         // if we removed the first style by accident, recreate it
  732.         if (count($this->_cellXfCollection== 0{
  733.             $this->_cellXfCollection[new PHPExcel_Style();
  734.         }
  735.  
  736.         // update the xfIndex for all cells
  737.         foreach ($this->getWorksheetIterator(as $sheet{
  738.             foreach ($sheet->getCellCollection(falseas $cell{
  739.                 $cell->setXfIndex$map[$cell->getXfIndex());
  740.             }
  741.         }
  742.  
  743.         // also do garbage collection for all the sheets
  744.         foreach ($this->getWorksheetIterator(as $sheet{
  745.             $sheet->garbageCollect();
  746.         }
  747.     }
  748.  
  749. }

Documentation generated on Mon, 10 Aug 2009 08:07:20 +0200 by phpDocumentor 1.4.1