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

Public Member Functions

 notifyCacheController ()
 Send notification to the cache controller. More...
 
 detach ()
 
 attach (PHPExcel_CachedObjectStorage_CacheBase $parent)
 
 __construct ($pValue=NULL, $pDataType=NULL, PHPExcel_Worksheet $pSheet=NULL)
 Create a new Cell. More...
 
 getColumn ()
 Get cell coordinate column. More...
 
 getRow ()
 Get cell coordinate row. More...
 
 getCoordinate ()
 Get cell coordinate. More...
 
 getValue ()
 Get cell value. More...
 
 getFormattedValue ()
 Get cell value with formatting. More...
 
 setValue ($pValue=NULL)
 Set cell value. More...
 
 setValueExplicit ($pValue=NULL, $pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
 Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder) More...
 
 getCalculatedValue ($resetLog=TRUE)
 Get calculated cell value. More...
 
 setCalculatedValue ($pValue=NULL)
 Set old calculated value (cached) More...
 
 getOldCalculatedValue ()
 Get old calculated value (cached) This returns the value last calculated by MS Excel or whichever spreadsheet program was used to create the original spreadsheet file. More...
 
 getDataType ()
 Get cell data type. More...
 
 setDataType ($pDataType=PHPExcel_Cell_DataType::TYPE_STRING)
 Set cell data type. More...
 
 isFormula ()
 Identify if the cell contains a formula. More...
 
 hasDataValidation ()
 Does this cell contain Data validation rules? More...
 
 getDataValidation ()
 Get Data validation rules. More...
 
 setDataValidation (PHPExcel_Cell_DataValidation $pDataValidation=NULL)
 Set Data validation rules. More...
 
 hasHyperlink ()
 Does this cell contain a Hyperlink? More...
 
 getHyperlink ()
 Get Hyperlink. More...
 
 setHyperlink (PHPExcel_Cell_Hyperlink $pHyperlink=NULL)
 Set Hyperlink. More...
 
 getParent ()
 Get parent worksheet. More...
 
 getWorksheet ()
 Get parent worksheet. More...
 
 isInMergeRange ()
 Is this cell in a merge range. More...
 
 isMergeRangeValueCell ()
 Is this cell the master (top left cell) in a merge range (that holds the actual data value) More...
 
 getMergeRange ()
 If this cell is in a merge range, then return the range. More...
 
 getStyle ()
 Get cell style. More...
 
 rebindParent (PHPExcel_Worksheet $parent)
 Re-bind parent. More...
 
 isInRange ($pRange='A1:A1')
 Is cell in a specific range? More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
 getXfIndex ()
 Get index to cellXf. More...
 
 setXfIndex ($pValue=0)
 Set index to cellXf. More...
 
 setFormulaAttributes ($pAttributes)
 
 getFormulaAttributes ()
 
 __toString ()
 Convert to string. More...
 

Static Public Member Functions

static coordinateFromString ($pCoordinateString='A1')
 Coordinate from string. More...
 
static absoluteReference ($pCoordinateString='A1')
 Make string row, column or cell coordinate absolute. More...
 
static absoluteCoordinate ($pCoordinateString='A1')
 Make string coordinate absolute. More...
 
static splitRange ($pRange='A1:A1')
 Split range into coordinate strings. More...
 
static buildRange ($pRange)
 Build range from coordinate strings. More...
 
static rangeBoundaries ($pRange='A1:A1')
 Calculate range boundaries. More...
 
static rangeDimension ($pRange='A1:A1')
 Calculate range dimension. More...
 
static getRangeBoundaries ($pRange='A1:A1')
 Calculate range boundaries. More...
 
static columnIndexFromString ($pString='A')
 Column index from string. More...
 
static stringFromColumnIndex ($pColumnIndex=0)
 String from columnindex. More...
 
static extractAllCellReferencesInRange ($pRange='A1')
 Extract all cell references in range. More...
 
static compareCells (PHPExcel_Cell $a, PHPExcel_Cell $b)
 Compare 2 cells. More...
 
static getValueBinder ()
 Get value binder to use. More...
 
static setValueBinder (PHPExcel_Cell_IValueBinder $binder=NULL)
 Set value binder to use. More...
 

Data Fields

const DEFAULT_RANGE = 'A1:A1'
 

Private Attributes

 $_value
 
 $_calculatedValue = NULL
 
 $_dataType
 
 $_parent
 
 $_xfIndex = 0
 
 $_formulaAttributes
 Attributes of the formula. More...
 

Static Private Attributes

static $_valueBinder = NULL
 

Detailed Description

Definition at line 36 of file Cell.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Cell::__construct (   $pValue = NULL,
  $pDataType = NULL,
PHPExcel_Worksheet  $pSheet = NULL 
)

Create a new Cell.

Parameters
mixed$pValue
string$pDataType
PHPExcel_Worksheet$pSheet
Exceptions
PHPExcel_Exception

Definition at line 128 of file Cell.php.

129 {
130 // Initialise cell value
131 $this->_value = $pValue;
132
133 // Set worksheet cache
134 $this->_parent = $pSheet->getCellCacheController();
135
136 // Set datatype?
137 if ($pDataType !== NULL) {
138 if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
140 $this->_dataType = $pDataType;
141 } elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
142 throw new PHPExcel_Exception("Value could not be bound to cell.");
143 }
144 }
getCellCacheController()
Return the cache controller for the cell collection.
Definition: Worksheet.php:413

References PHPExcel_Cell_DataType\TYPE_STRING, and PHPExcel_Cell_DataType\TYPE_STRING2.

Member Function Documentation

◆ __clone()

PHPExcel_Cell::__clone ( )

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

Definition at line 960 of file Cell.php.

960 {
961 $vars = get_object_vars($this);
962 foreach ($vars as $key => $value) {
963 if ((is_object($value)) && ($key != '_parent')) {
964 $this->$key = clone $value;
965 } else {
966 $this->$key = $value;
967 }
968 }
969 }

◆ __toString()

PHPExcel_Cell::__toString ( )

Convert to string.

Returns
string

Definition at line 1016 of file Cell.php.

1017 {
1018 return (string) $this->getValue();
1019 }
getValue()
Get cell value.
Definition: Cell.php:181

References getValue().

+ Here is the call graph for this function:

◆ absoluteCoordinate()

static PHPExcel_Cell::absoluteCoordinate (   $pCoordinateString = 'A1')
static

Make string coordinate absolute.

Parameters
string$pCoordinateStringe.g. 'A1'
Returns
string Absolute coordinate e.g. '$A$1'
Exceptions
PHPExcel_Exception

Definition at line 631 of file Cell.php.

632 {
633 if (strpos($pCoordinateString,':') === FALSE && strpos($pCoordinateString,',') === FALSE) {
634 // Split out any worksheet name from the coordinate
635 $worksheet = '';
636 $cellAddress = explode('!',$pCoordinateString);
637 if (count($cellAddress) > 1) {
638 list($worksheet,$pCoordinateString) = $cellAddress;
639 }
640 if ($worksheet > '') $worksheet .= '!';
641
642 // Create absolute coordinate
643 list($column, $row) = self::coordinateFromString($pCoordinateString);
644 $column = ltrim($column,'$');
645 $row = ltrim($row,'$');
646 return $worksheet . '$' . $column . '$' . $row;
647 }
648
649 throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
650 }
$column
Definition: 39dropdown.php:62
$worksheet
static coordinateFromString($pCoordinateString='A1')
Coordinate from string.
Definition: Cell.php:580

References $column, $row, $worksheet, and coordinateFromString().

Referenced by absoluteReference().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ absoluteReference()

static PHPExcel_Cell::absoluteReference (   $pCoordinateString = 'A1')
static

Make string row, column or cell coordinate absolute.

Parameters
string$pCoordinateStringe.g. 'A' or '1' or 'A1' Note that this value can be a row or column reference as well as a cell reference
Returns
string Absolute coordinate e.g. '$A' or '$1' or '$A$1'
Exceptions
PHPExcel_Exception

Definition at line 601 of file Cell.php.

602 {
603 if (strpos($pCoordinateString,':') === FALSE && strpos($pCoordinateString,',') === FALSE) {
604 // Split out any worksheet name from the reference
605 $worksheet = '';
606 $cellAddress = explode('!',$pCoordinateString);
607 if (count($cellAddress) > 1) {
608 list($worksheet,$pCoordinateString) = $cellAddress;
609 }
610 if ($worksheet > '') $worksheet .= '!';
611
612 // Create absolute coordinate
613 if (ctype_digit($pCoordinateString)) {
614 return $worksheet . '$' . $pCoordinateString;
615 } elseif (ctype_alpha($pCoordinateString)) {
616 return $worksheet . '$' . strtoupper($pCoordinateString);
617 }
618 return $worksheet . self::absoluteCoordinate($pCoordinateString);
619 }
620
621 throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
622 }
static absoluteCoordinate($pCoordinateString='A1')
Make string coordinate absolute.
Definition: Cell.php:631

References $worksheet, and absoluteCoordinate().

+ Here is the call graph for this function:

◆ attach()

PHPExcel_Cell::attach ( PHPExcel_CachedObjectStorage_CacheBase  $parent)

Definition at line 115 of file Cell.php.

115 {
116 $this->_parent = $parent;
117 }

◆ buildRange()

static PHPExcel_Cell::buildRange (   $pRange)
static

Build range from coordinate strings.

Parameters
array$pRangeArray containg one or more arrays containing one or two coordinate strings
Returns
string String representation of $pRange
Exceptions
PHPExcel_Exception

Definition at line 682 of file Cell.php.

683 {
684 // Verify range
685 if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) {
686 throw new PHPExcel_Exception('Range does not contain any information');
687 }
688
689 // Build range
690 $imploded = array();
691 $counter = count($pRange);
692 for ($i = 0; $i < $counter; ++$i) {
693 $pRange[$i] = implode(':', $pRange[$i]);
694 }
695 $imploded = implode(',', $pRange);
696
697 return $imploded;
698 }
$counter

References $counter.

Referenced by PHPExcel_ReferenceHelper\_updateCellRange().

+ Here is the caller graph for this function:

◆ columnIndexFromString()

static PHPExcel_Cell::columnIndexFromString (   $pString = 'A')
static

Column index from string.

Parameters
string$pString
Returns
int Column index (base 1 !!!)

Definition at line 782 of file Cell.php.

783 {
784 // Using a lookup cache adds a slight memory overhead, but boosts speed
785 // caching using a static within the method is faster than a class static,
786 // though it's additional memory overhead
787 static $_indexCache = array();
788
789 if (isset($_indexCache[$pString]))
790 return $_indexCache[$pString];
791
792 // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord()
793 // and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant
794 // memory overhead either
795 static $_columnLookup = array(
796 'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13,
797 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26,
798 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13,
799 'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26
800 );
801
802 // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
803 // for improved performance
804 if (isset($pString{0})) {
805 if (!isset($pString{1})) {
806 $_indexCache[$pString] = $_columnLookup[$pString];
807 return $_indexCache[$pString];
808 } elseif(!isset($pString{2})) {
809 $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}];
810 return $_indexCache[$pString];
811 } elseif(!isset($pString{3})) {
812 $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}];
813 return $_indexCache[$pString];
814 }
815 }
816 throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
817 }

Referenced by PHPExcel_Writer_Excel5_Worksheet\__construct(), PHPExcel_Worksheet_ColumnCellIterator\__construct(), PHPExcel_Writer_HTML\_calculateSpans(), PHPExcel_Reader_Excel2007\_castToFormula(), PHPExcel_Worksheet\_createNewCell(), PHPExcel_Writer_HTML\_extendRowsForChartsAndImages(), PHPExcel_Writer_HTML\_generateTableHeader(), PHPExcel_Calculation\_processTokenStack(), PHPExcel_Reader_Excel5\_readBIFF8CellAddressB(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddressB(), PHPExcel_ReferenceHelper\_updateSingleCellReference(), PHPExcel_Writer_Excel5_Worksheet\_writeBIFF8CellRangeAddressFixed(), PHPExcel_Writer_Excel5_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel2007_Worksheet\_writeBreaks(), PHPExcel_Writer_OpenDocument_Content\_writeCells(), PHPExcel_Writer_Excel5_Worksheet\_writeCFHeader(), PHPExcel_Writer_Excel2007_Drawing\_writeChart(), PHPExcel_Writer_Excel2007_Worksheet\_writeCols(), PHPExcel_Writer_Excel2007_Drawing\_writeDrawing(), PHPExcel_Writer_Excel5_Worksheet\_writeMergedCells(), PHPExcel_Writer_Excel5_Workbook\_writeNames(), PHPExcel_Writer_Excel5_Worksheet\_writePanes(), PHPExcel_Writer_Excel5_Worksheet\_writeSelection(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetData(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetViews(), PHPExcel_Writer_Excel2007_Comments\_writeVMLComment(), PHPExcel_Style\applyFromArray(), PHPExcel_Writer_HTML\buildCSS(), PHPExcel_ReferenceHelper\cellAddressInDeleteRange(), PHPExcel_Writer_Excel5_Escher\close(), PHPExcel_Writer_Excel5_Worksheet\close(), PHPExcel_Calculation_LookupRef\COLUMN(), PHPExcel_Worksheet\garbageCollect(), PHPExcel_Writer_HTML\generateSheetData(), ilExcel\getColumnCount(), PHPExcel_Worksheet\getColumnDimension(), PHPExcel_Shared_Excel5\getDistanceX(), PHPExcel_CachedObjectStorage_CacheBase\getHighestColumn(), PHPExcel_ReferenceHelper\insertNewBefore(), isInRange(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), PHPExcel_Reader_OOCalc\loadIntoExisting(), PHPExcel_Calculation_LookupRef\OFFSET(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), rangeBoundaries(), PHPExcel_Worksheet\removeColumn(), PHPExcel_Worksheet_ColumnIterator\resetEnd(), PHPExcel_Worksheet_RowCellIterator\resetEnd(), PHPExcel_Worksheet_ColumnIterator\resetStart(), PHPExcel_Worksheet_RowCellIterator\resetStart(), PHPExcel_Worksheet_ColumnIterator\seek(), PHPExcel_Worksheet_RowCellIterator\seek(), PHPExcel_Worksheet_AutoFilter\setRange(), PHPExcel_Worksheet\shrinkRangeToFit(), PHPExcel_Worksheet_AutoFilter\testColumnInRange(), and PHPExcel_ReferenceHelper\updateFormulaReferences().

+ Here is the caller graph for this function:

◆ compareCells()

static PHPExcel_Cell::compareCells ( PHPExcel_Cell  $a,
PHPExcel_Cell  $b 
)
static

Compare 2 cells.

Parameters
PHPExcel_Cell$aCell a
PHPExcel_Cell$bCell b
Returns
int Result of comparison (always -1 or 1, never zero!)

Definition at line 917 of file Cell.php.

918 {
919 if ($a->getRow() < $b->getRow()) {
920 return -1;
921 } elseif ($a->getRow() > $b->getRow()) {
922 return 1;
923 } elseif (self::columnIndexFromString($a->getColumn()) < self::columnIndexFromString($b->getColumn())) {
924 return -1;
925 } else {
926 return 1;
927 }
928 }
getRow()
Get cell coordinate row.
Definition: Cell.php:161
getColumn()
Get cell coordinate column.
Definition: Cell.php:151

References getColumn(), and getRow().

+ Here is the call graph for this function:

◆ coordinateFromString()

static PHPExcel_Cell::coordinateFromString (   $pCoordinateString = 'A1')
static

Coordinate from string.

Parameters
string$pCoordinateString
Returns
array Array containing column and row (indexes 0 and 1)
Exceptions
PHPExcel_Exception

Definition at line 580 of file Cell.php.

581 {
582 if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
583 return array($matches[1],$matches[2]);
584 } elseif ((strpos($pCoordinateString,':') !== FALSE) || (strpos($pCoordinateString,',') !== FALSE)) {
585 throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
586 } elseif ($pCoordinateString == '') {
587 throw new PHPExcel_Exception('Cell coordinate can not be zero-length string');
588 }
589
590 throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString);
591 }

Referenced by PHPExcel_ReferenceHelper\_adjustColumnDimensions(), PHPExcel_ReferenceHelper\_adjustRowDimensions(), PHPExcel_Writer_HTML\_calculateSpans(), PHPExcel_Reader_Excel2007\_castToFormula(), PHPExcel_Worksheet\_createNewCell(), PHPExcel_Writer_HTML\_extendRowsForChartsAndImages(), PHPExcel_Calculation\_processTokenStack(), PHPExcel_Reader_Excel5\_readBIFF8CellAddressB(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddressB(), PHPExcel_ReferenceHelper\_updateCellRange(), PHPExcel_ReferenceHelper\_updateSingleCellReference(), PHPExcel_Writer_Excel5_Worksheet\_writeBIFF8CellRangeAddressFixed(), PHPExcel_Writer_Excel5_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel2007_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel5_Worksheet\_writeCFHeader(), PHPExcel_Writer_Excel2007_Drawing\_writeChart(), PHPExcel_Writer_Excel2007_Drawing\_writeDrawing(), PHPExcel_Writer_Excel5_Worksheet\_writeMergedCells(), PHPExcel_Writer_Excel5_Workbook\_writeNames(), PHPExcel_Writer_Excel5_Worksheet\_writePanes(), PHPExcel_Writer_Excel5_Worksheet\_writeSelection(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetData(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetViews(), PHPExcel_Writer_Excel2007_Comments\_writeVMLComment(), absoluteCoordinate(), PHPExcel_Style\applyFromArray(), PHPExcel_ReferenceHelper\cellAddressInDeleteRange(), PHPExcel_Worksheet\cellExists(), PHPExcel_Writer_Excel5_Escher\close(), PHPExcel_Writer_Excel5_Worksheet\close(), PHPExcel_Calculation\extractNamedRange(), PHPExcel_Worksheet\fromArray(), PHPExcel_Writer_HTML\generateSheetData(), PHPExcel_ReferenceHelper\insertNewBefore(), PHPExcel_Reader_Excel2007\load(), PHPExcel_Reader_Excel5\load(), PHPExcel_Calculation_LookupRef\OFFSET(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), rangeBoundaries(), and PHPExcel_ReferenceHelper\updateFormulaReferences().

+ Here is the caller graph for this function:

◆ detach()

PHPExcel_Cell::detach ( )

Definition at line 111 of file Cell.php.

111 {
112 $this->_parent = NULL;
113 }

◆ extractAllCellReferencesInRange()

static PHPExcel_Cell::extractAllCellReferencesInRange (   $pRange = 'A1')
static

Extract all cell references in range.

Parameters
string$pRangeRange (e.g. A1 or A1:C10 or A1:E10 A20:E25)
Returns
array Array containing single cell references

Definition at line 854 of file Cell.php.

854 {
855 // Returnvalue
856 $returnValue = array();
857
858 // Explode spaces
859 $cellBlocks = explode(' ', str_replace('$', '', strtoupper($pRange)));
860 foreach ($cellBlocks as $cellBlock) {
861 // Single cell?
862 if (strpos($cellBlock,':') === FALSE && strpos($cellBlock,',') === FALSE) {
863 $returnValue[] = $cellBlock;
864 continue;
865 }
866
867 // Range...
868 $ranges = self::splitRange($cellBlock);
869 foreach($ranges as $range) {
870 // Single cell?
871 if (!isset($range[1])) {
872 $returnValue[] = $range[0];
873 continue;
874 }
875
876 // Range...
877 list($rangeStart, $rangeEnd) = $range;
878 sscanf($rangeStart,'%[A-Z]%d', $startCol, $startRow);
879 sscanf($rangeEnd,'%[A-Z]%d', $endCol, $endRow);
880 $endCol++;
881
882 // Current data
883 $currentCol = $startCol;
884 $currentRow = $startRow;
885
886 // Loop cells
887 while ($currentCol != $endCol) {
888 while ($currentRow <= $endRow) {
889 $returnValue[] = $currentCol.$currentRow;
890 ++$currentRow;
891 }
892 ++$currentCol;
893 $currentRow = $startRow;
894 }
895 }
896 }
897
898 // Sort the result by column and row
899 $sortKeys = array();
900 foreach (array_unique($returnValue) as $coord) {
901 sscanf($coord,'%[A-Z]%d', $column, $row);
902 $sortKeys[sprintf('%3s%09d',$column,$row)] = $coord;
903 }
904 ksort($sortKeys);
905
906 // Return value
907 return array_values($sortKeys);
908 }
sprintf('%.4f', $callTime)
static splitRange($pRange='A1:A1')
Split range into coordinate strings.
Definition: Cell.php:660

References $column, $row, splitRange(), and sprintf.

Referenced by PHPExcel_Reader_HTML\_processDomElement(), PHPExcel_Reader_Excel5\_readDataValidation(), PHPExcel_Reader_Excel5\_readHyperLink(), PHPExcel_Worksheet\calculateColumnWidths(), PHPExcel_Calculation\extractCellRange(), PHPExcel_Calculation\extractNamedRange(), PHPExcel_Reader_Excel2007\load(), and PHPExcel_Worksheet\mergeCells().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCalculatedValue()

PHPExcel_Cell::getCalculatedValue (   $resetLog = TRUE)

Get calculated cell value.

Deprecated:
Since version 1.7.8 for planned changes to cell for array formula handling
Parameters
boolean$resetLogWhether the calculation engine logger should be reset or not
Returns
mixed
Exceptions
PHPExcel_Exception

Definition at line 270 of file Cell.php.

271 {
272//echo 'Cell '.$this->getCoordinate().' value is a '.$this->_dataType.' with a value of '.$this->getValue().PHP_EOL;
273 if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
274 try {
275//echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL;
277 $this->getWorksheet()->getParent()
278 )->calculateCellValue($this,$resetLog);
279//echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL;
280 // We don't yet handle array returns
281 if (is_array($result)) {
282 while (is_array($result)) {
283 $result = array_pop($result);
284 }
285 }
286 } catch ( PHPExcel_Exception $ex ) {
287 if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->_calculatedValue !== NULL)) {
288//echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
289 return $this->_calculatedValue; // Fallback for calculations referencing external files.
290 }
291//echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
292 $result = '#N/A';
294 $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
295 );
296 }
297
298 if ($result === '#Not Yet Implemented') {
299//echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
300 return $this->_calculatedValue; // Fallback if calculation engine does not support the formula.
301 }
302//echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL;
303 return $result;
304 } elseif($this->_value instanceof PHPExcel_RichText) {
305// echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->_value.'<br />';
306 return $this->_value->getPlainText();
307 }
308// echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->_value.'<br />';
309 return $this->_value;
310 }
$result
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.
getParent()
Get parent worksheet.
Definition: Cell.php:479
$_calculatedValue
Definition: Cell.php:70
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171

References $_calculatedValue, $_value, $result, getCoordinate(), PHPExcel_Calculation\getInstance(), getParent(), getWorksheet(), and PHPExcel_Cell_DataType\TYPE_FORMULA.

Referenced by getFormattedValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumn()

PHPExcel_Cell::getColumn ( )

Get cell coordinate column.

Returns
string

Definition at line 151 of file Cell.php.

152 {
153 return $this->_parent->getCurrentColumn();
154 }

Referenced by compareCells(), and isInRange().

+ Here is the caller graph for this function:

◆ getCoordinate()

PHPExcel_Cell::getCoordinate ( )

◆ getDataType()

PHPExcel_Cell::getDataType ( )

Get cell data type.

Returns
string

Definition at line 347 of file Cell.php.

348 {
349 return $this->_dataType;
350 }

References $_dataType.

◆ getDataValidation()

PHPExcel_Cell::getDataValidation ( )

Get Data validation rules.

Returns
PHPExcel_Cell_DataValidation
Exceptions
PHPExcel_Exception

Definition at line 399 of file Cell.php.

400 {
401 if (!isset($this->_parent)) {
402 throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet');
403 }
404
405 return $this->getWorksheet()->getDataValidation($this->getCoordinate());
406 }

References getCoordinate(), and getWorksheet().

+ Here is the call graph for this function:

◆ getFormattedValue()

PHPExcel_Cell::getFormattedValue ( )

Get cell value with formatting.

Returns
string

Definition at line 191 of file Cell.php.

192 {
194 $this->getCalculatedValue(),
195 $this->getStyle()
196 ->getNumberFormat()->getFormatCode()
197 );
198 }
getCalculatedValue($resetLog=TRUE)
Get calculated cell value.
Definition: Cell.php:270
getStyle()
Get cell style.
Definition: Cell.php:536
static toFormattedString($value='0', $format=PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack=null)
Convert a value in a pre-defined format to a PHP string.

References getCalculatedValue(), getStyle(), and PHPExcel_Style_NumberFormat\toFormattedString().

+ Here is the call graph for this function:

◆ getFormulaAttributes()

PHPExcel_Cell::getFormulaAttributes ( )
Deprecated:
Since version 1.7.8 for planned changes to cell for array formula handling

Definition at line 1006 of file Cell.php.

1007 {
1009 }
$_formulaAttributes
Attributes of the formula.
Definition: Cell.php:97

References $_formulaAttributes.

◆ getHyperlink()

PHPExcel_Cell::getHyperlink ( )

Get Hyperlink.

Returns
PHPExcel_Cell_Hyperlink
Exceptions
PHPExcel_Exception

Definition at line 447 of file Cell.php.

448 {
449 if (!isset($this->_parent)) {
450 throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
451 }
452
453 return $this->getWorksheet()->getHyperlink($this->getCoordinate());
454 }

References getCoordinate(), and getWorksheet().

+ Here is the call graph for this function:

◆ getMergeRange()

PHPExcel_Cell::getMergeRange ( )

If this cell is in a merge range, then return the range.

Returns
string

Definition at line 522 of file Cell.php.

522 {
523 foreach($this->getWorksheet()->getMergeCells() as $mergeRange) {
524 if ($this->isInRange($mergeRange)) {
525 return $mergeRange;
526 }
527 }
528 return false;
529 }
isInRange($pRange='A1:A1')
Is cell in a specific range?
Definition: Cell.php:559

References getWorksheet(), and isInRange().

Referenced by isInMergeRange(), and isMergeRangeValueCell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOldCalculatedValue()

PHPExcel_Cell::getOldCalculatedValue ( )

Get old calculated value (cached) This returns the value last calculated by MS Excel or whichever spreadsheet program was used to create the original spreadsheet file.

Note that this value is not guaranteed to refelect the actual calculated value because it is possible that auto-calculation was disabled in the original spreadsheet, and underlying data values used by the formula have changed since it was last calculated.

Returns
mixed

Definition at line 337 of file Cell.php.

338 {
340 }

References $_calculatedValue.

◆ getParent()

PHPExcel_Cell::getParent ( )

Get parent worksheet.

Returns
PHPExcel_CachedObjectStorage_CacheBase

Definition at line 479 of file Cell.php.

479 {
480 return $this->_parent;
481 }

References $_parent.

Referenced by getCalculatedValue().

+ Here is the caller graph for this function:

◆ getRangeBoundaries()

static PHPExcel_Cell::getRangeBoundaries (   $pRange = 'A1:A1')
static

Calculate range boundaries.

Parameters
string$pRangeCell range (e.g. A1:A1)
Returns
array Range coordinates array(Start Cell, End Cell) where Start Cell and End Cell are arrays (Column ID, Row Number)

Definition at line 756 of file Cell.php.

756 :A1')
757 {
758 // Ensure $pRange is a valid range
759 if(empty($pRange)) {
760 $pRange = self::DEFAULT_RANGE;
761 }
762
763 // Uppercase coordinate
764 $pRange = strtoupper($pRange);
765
766 // Extract range
767 if (strpos($pRange, ':') === FALSE) {
768 $rangeA = $rangeB = $pRange;
769 } else {
770 list($rangeA, $rangeB) = explode(':', $pRange);
771 }
772
773 return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB));
774 }

References DEFAULT_RANGE.

Referenced by PHPExcel_Reader_Excel5\_includeCellRangeFiltered(), and PHPExcel_Worksheet\shrinkRangeToFit().

+ Here is the caller graph for this function:

◆ getRow()

PHPExcel_Cell::getRow ( )

Get cell coordinate row.

Returns
int

Definition at line 161 of file Cell.php.

162 {
163 return $this->_parent->getCurrentRow();
164 }

Referenced by compareCells(), and isInRange().

+ Here is the caller graph for this function:

◆ getStyle()

PHPExcel_Cell::getStyle ( )

Get cell style.

Returns
PHPExcel_Style

Definition at line 536 of file Cell.php.

537 {
538 return $this->getWorksheet()->getStyle($this->getCoordinate());
539 }

References getCoordinate(), and getWorksheet().

Referenced by getFormattedValue(), and ilExcel\setDateFormat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValue()

PHPExcel_Cell::getValue ( )

Get cell value.

Returns
mixed

Definition at line 181 of file Cell.php.

182 {
183 return $this->_value;
184 }

References $_value.

Referenced by __toString().

+ Here is the caller graph for this function:

◆ getValueBinder()

static PHPExcel_Cell::getValueBinder ( )
static

Get value binder to use.

Returns
PHPExcel_Cell_IValueBinder

Definition at line 935 of file Cell.php.

935 {
936 if (self::$_valueBinder === NULL) {
937 self::$_valueBinder = new PHPExcel_Cell_DefaultValueBinder();
938 }
939
940 return self::$_valueBinder;
941 }
static $_valueBinder
Definition: Cell.php:51

References $_valueBinder.

◆ getWorksheet()

PHPExcel_Cell::getWorksheet ( )

◆ getXfIndex()

PHPExcel_Cell::getXfIndex ( )

Get index to cellXf.

Returns
int

Definition at line 976 of file Cell.php.

977 {
978 return $this->_xfIndex;
979 }

References $_xfIndex.

◆ hasDataValidation()

PHPExcel_Cell::hasDataValidation ( )

Does this cell contain Data validation rules?

Returns
boolean
Exceptions
PHPExcel_Exception

Definition at line 384 of file Cell.php.

385 {
386 if (!isset($this->_parent)) {
387 throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet');
388 }
389
390 return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
391 }

References getCoordinate(), and getWorksheet().

+ Here is the call graph for this function:

◆ hasHyperlink()

PHPExcel_Cell::hasHyperlink ( )

Does this cell contain a Hyperlink?

Returns
boolean
Exceptions
PHPExcel_Exception

Definition at line 432 of file Cell.php.

433 {
434 if (!isset($this->_parent)) {
435 throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
436 }
437
438 return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
439 }

References getCoordinate(), and getWorksheet().

+ Here is the call graph for this function:

◆ isFormula()

PHPExcel_Cell::isFormula ( )

Identify if the cell contains a formula.

Returns
boolean

Definition at line 373 of file Cell.php.

374 {
375 return $this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA;
376 }

References PHPExcel_Cell_DataType\TYPE_FORMULA.

◆ isInMergeRange()

PHPExcel_Cell::isInMergeRange ( )

Is this cell in a merge range.

Returns
boolean

Definition at line 497 of file Cell.php.

497 {
498 return (boolean) $this->getMergeRange();
499 }
getMergeRange()
If this cell is in a merge range, then return the range.
Definition: Cell.php:522

References getMergeRange().

+ Here is the call graph for this function:

◆ isInRange()

PHPExcel_Cell::isInRange (   $pRange = 'A1:A1')

Is cell in a specific range?

Parameters
string$pRangeCell range (e.g. A1:A1)
Returns
boolean

Definition at line 559 of file Cell.php.

559 :A1')
560 {
561 list($rangeStart,$rangeEnd) = self::rangeBoundaries($pRange);
562
563 // Translate properties
564 $myColumn = self::columnIndexFromString($this->getColumn());
565 $myRow = $this->getRow();
566
567 // Verify if cell is in range
568 return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
569 ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow)
570 );
571 }

References columnIndexFromString(), getColumn(), getRow(), and rangeBoundaries().

Referenced by getMergeRange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMergeRangeValueCell()

PHPExcel_Cell::isMergeRangeValueCell ( )

Is this cell the master (top left cell) in a merge range (that holds the actual data value)

Returns
boolean

Definition at line 506 of file Cell.php.

506 {
507 if ($mergeRange = $this->getMergeRange()) {
508 $mergeRange = PHPExcel_Cell::splitRange($mergeRange);
509 list($startCell) = $mergeRange[0];
510 if ($this->getCoordinate() === $startCell) {
511 return true;
512 }
513 }
514 return false;
515 }

References getCoordinate(), getMergeRange(), and splitRange().

+ Here is the call graph for this function:

◆ notifyCacheController()

PHPExcel_Cell::notifyCacheController ( )

Send notification to the cache controller.

Returns
void

Definition at line 105 of file Cell.php.

105 {
106 $this->_parent->updateCacheData($this);
107
108 return $this;
109 }

Referenced by rebindParent(), setCalculatedValue(), setDataType(), setDataValidation(), setHyperlink(), setValueExplicit(), and setXfIndex().

+ Here is the caller graph for this function:

◆ rangeBoundaries()

static PHPExcel_Cell::rangeBoundaries (   $pRange = 'A1:A1')
static

Calculate range boundaries.

Parameters
string$pRangeCell range (e.g. A1:A1)
Returns
array Range coordinates array(Start Cell, End Cell) where Start Cell and End Cell are arrays (Column Number, Row Number)

Definition at line 707 of file Cell.php.

707 :A1')
708 {
709 // Ensure $pRange is a valid range
710 if(empty($pRange)) {
711 $pRange = self::DEFAULT_RANGE;
712 }
713
714 // Uppercase coordinate
715 $pRange = strtoupper($pRange);
716
717 // Extract range
718 if (strpos($pRange, ':') === FALSE) {
719 $rangeA = $rangeB = $pRange;
720 } else {
721 list($rangeA, $rangeB) = explode(':', $pRange);
722 }
723
724 // Calculate range outer borders
725 $rangeStart = self::coordinateFromString($rangeA);
726 $rangeEnd = self::coordinateFromString($rangeB);
727
728 // Translate column into index
729 $rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
730 $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
731
732 return array($rangeStart, $rangeEnd);
733 }

References columnIndexFromString(), coordinateFromString(), and DEFAULT_RANGE.

Referenced by PHPExcel_Writer_Excel5\_buildWorksheetEschers(), PHPExcel_Writer_Excel5_Worksheet\_writeAutoFilterInfo(), PHPExcel_Worksheet\duplicateConditionalStyle(), PHPExcel_Worksheet\duplicateStyle(), PHPExcel_Worksheet_AutoFilter\getColumnByOffset(), PHPExcel_ReferenceHelper\insertNewBefore(), isInRange(), rangeDimension(), PHPExcel_Worksheet\rangeToArray(), PHPExcel_Worksheet_AutoFilter\setRange(), PHPExcel_Worksheet_AutoFilter\showHideRows(), and PHPExcel_Worksheet_AutoFilter\testColumnInRange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rangeDimension()

static PHPExcel_Cell::rangeDimension (   $pRange = 'A1:A1')
static

Calculate range dimension.

Parameters
string$pRangeCell range (e.g. A1:A1)
Returns
array Range dimension (width, height)

Definition at line 741 of file Cell.php.

741 :A1')
742 {
743 // Calculate range outer borders
744 list($rangeStart,$rangeEnd) = self::rangeBoundaries($pRange);
745
746 return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) );
747 }

References rangeBoundaries().

Referenced by PHPExcel_Chart_DataSeriesValues\refresh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rebindParent()

PHPExcel_Cell::rebindParent ( PHPExcel_Worksheet  $parent)

Re-bind parent.

Parameters
PHPExcel_Worksheet$parent
Returns
PHPExcel_Cell

Definition at line 547 of file Cell.php.

547 {
548 $this->_parent = $parent->getCellCacheController();
549
550 return $this->notifyCacheController();
551 }
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105

References PHPExcel_Worksheet\getCellCacheController(), and notifyCacheController().

+ Here is the call graph for this function:

◆ setCalculatedValue()

PHPExcel_Cell::setCalculatedValue (   $pValue = NULL)

Set old calculated value (cached)

Parameters
mixed$pValueValue
Returns
PHPExcel_Cell

Definition at line 318 of file Cell.php.

319 {
320 if ($pValue !== NULL) {
321 $this->_calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
322 }
323
324 return $this->notifyCacheController();
325 }

References notifyCacheController().

+ Here is the call graph for this function:

◆ setDataType()

PHPExcel_Cell::setDataType (   $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)

Set cell data type.

Parameters
string$pDataType
Returns
PHPExcel_Cell

Definition at line 358 of file Cell.php.

359 {
360 if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
362
363 $this->_dataType = $pDataType;
364
365 return $this->notifyCacheController();
366 }

References notifyCacheController(), PHPExcel_Cell_DataType\TYPE_STRING, and PHPExcel_Cell_DataType\TYPE_STRING2.

+ Here is the call graph for this function:

◆ setDataValidation()

PHPExcel_Cell::setDataValidation ( PHPExcel_Cell_DataValidation  $pDataValidation = NULL)

Set Data validation rules.

Parameters
PHPExcel_Cell_DataValidation$pDataValidation
Returns
PHPExcel_Cell
Exceptions
PHPExcel_Exception

Definition at line 415 of file Cell.php.

416 {
417 if (!isset($this->_parent)) {
418 throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
419 }
420
421 $this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
422
423 return $this->notifyCacheController();
424 }

References getCoordinate(), getWorksheet(), and notifyCacheController().

+ Here is the call graph for this function:

◆ setFormulaAttributes()

PHPExcel_Cell::setFormulaAttributes (   $pAttributes)
Deprecated:
Since version 1.7.8 for planned changes to cell for array formula handling

Definition at line 997 of file Cell.php.

998 {
999 $this->_formulaAttributes = $pAttributes;
1000 return $this;
1001 }

◆ setHyperlink()

PHPExcel_Cell::setHyperlink ( PHPExcel_Cell_Hyperlink  $pHyperlink = NULL)

Set Hyperlink.

Parameters
PHPExcel_Cell_Hyperlink$pHyperlink
Returns
PHPExcel_Cell
Exceptions
PHPExcel_Exception

Definition at line 463 of file Cell.php.

464 {
465 if (!isset($this->_parent)) {
466 throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
467 }
468
469 $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
470
471 return $this->notifyCacheController();
472 }

References getCoordinate(), getWorksheet(), and notifyCacheController().

+ Here is the call graph for this function:

◆ setValue()

PHPExcel_Cell::setValue (   $pValue = NULL)

Set cell value.

Sets the value for a cell, automatically determining the datatype using the value binder

Parameters
mixed$pValueValue
Returns
PHPExcel_Cell
Exceptions
PHPExcel_Exception

Definition at line 209 of file Cell.php.

210 {
211 if (!self::getValueBinder()->bindValue($this, $pValue)) {
212 throw new PHPExcel_Exception("Value could not be bound to cell.");
213 }
214 return $this;
215 }

◆ setValueBinder()

static PHPExcel_Cell::setValueBinder ( PHPExcel_Cell_IValueBinder  $binder = NULL)
static

Set value binder to use.

Parameters
PHPExcel_Cell_IValueBinder$binder
Exceptions
PHPExcel_Exception

Definition at line 949 of file Cell.php.

949 {
950 if ($binder === NULL) {
951 throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly.");
952 }
953
954 self::$_valueBinder = $binder;
955 }

◆ setValueExplicit()

PHPExcel_Cell::setValueExplicit (   $pValue = NULL,
  $pDataType = PHPExcel_Cell_DataType::TYPE_STRING 
)

Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder)

Parameters
mixed$pValueValue
string$pDataTypeExplicit data type
Returns
PHPExcel_Cell
Exceptions
PHPExcel_Exception

Definition at line 225 of file Cell.php.

226 {
227 // set the value according to data type
228 switch ($pDataType) {
230 $this->_value = $pValue;
231 break;
236 $this->_value = PHPExcel_Cell_DataType::checkString($pValue);
237 break;
239 $this->_value = (float)$pValue;
240 break;
242 $this->_value = (string)$pValue;
243 break;
245 $this->_value = (bool)$pValue;
246 break;
248 $this->_value = PHPExcel_Cell_DataType::checkErrorCode($pValue);
249 break;
250 default:
251 throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType);
252 break;
253 }
254
255 // set the datatype
256 $this->_dataType = $pDataType;
257
258 return $this->notifyCacheController();
259 }
static checkString($pValue=null)
Check a string that it satisfies Excel requirements.
Definition: DataType.php:89
static checkErrorCode($pValue=null)
Check a value that it is a valid error code.
Definition: DataType.php:111

References PHPExcel_Cell_DataType\checkErrorCode(), PHPExcel_Cell_DataType\checkString(), notifyCacheController(), PHPExcel_Cell_DataType\TYPE_BOOL, PHPExcel_Cell_DataType\TYPE_ERROR, PHPExcel_Cell_DataType\TYPE_FORMULA, PHPExcel_Cell_DataType\TYPE_INLINE, PHPExcel_Cell_DataType\TYPE_NULL, PHPExcel_Cell_DataType\TYPE_NUMERIC, PHPExcel_Cell_DataType\TYPE_STRING, and PHPExcel_Cell_DataType\TYPE_STRING2.

Referenced by PHPExcel_Cell_AdvancedValueBinder\bindValue(), and PHPExcel_Cell_DefaultValueBinder\bindValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setXfIndex()

PHPExcel_Cell::setXfIndex (   $pValue = 0)

Set index to cellXf.

Parameters
int$pValue
Returns
PHPExcel_Cell

Definition at line 987 of file Cell.php.

988 {
989 $this->_xfIndex = $pValue;
990
991 return $this->notifyCacheController();
992 }

References notifyCacheController().

+ Here is the call graph for this function:

◆ splitRange()

static PHPExcel_Cell::splitRange (   $pRange = 'A1:A1')
static

Split range into coordinate strings.

Parameters
string$pRangee.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'
Returns
array Array containg one or more arrays containing one or two coordinate strings e.g. array('B4','D9') or array(array('B4','D9'),array('H2','O11')) or array('B4')

Definition at line 660 of file Cell.php.

660 :A1')
661 {
662 // Ensure $pRange is a valid range
663 if(empty($pRange)) {
664 $pRange = self::DEFAULT_RANGE;
665 }
666
667 $exploded = explode(',', $pRange);
668 $counter = count($exploded);
669 for ($i = 0; $i < $counter; ++$i) {
670 $exploded[$i] = explode(':', $exploded[$i]);
671 }
672 return $exploded;
673 }

References $counter, and DEFAULT_RANGE.

Referenced by PHPExcel_Writer_HTML\_calculateSpans(), PHPExcel_ReferenceHelper\_updateCellRange(), PHPExcel_Writer_Excel5_Workbook\_writeAllDefinedNamesBiff8(), PHPExcel_Writer_Excel2007_Worksheet\_writeAutoFilter(), PHPExcel_Writer_Excel2007_Workbook\_writeDefinedNameForNamedRange(), PHPExcel_Writer_Excel5_Worksheet\_writeMergedCells(), PHPExcel_Writer_Excel5_Workbook\_writeNames(), PHPExcel_Writer_Excel5_Worksheet\_writeSelection(), extractAllCellReferencesInRange(), PHPExcel_Calculation\extractNamedRange(), isMergeRangeValueCell(), and PHPExcel_Worksheet\setSelectedCells().

+ Here is the caller graph for this function:

◆ stringFromColumnIndex()

static PHPExcel_Cell::stringFromColumnIndex (   $pColumnIndex = 0)
static

String from columnindex.

Parameters
int$pColumnIndexColumn index (base 0 !!!)
Returns
string

Definition at line 825 of file Cell.php.

826 {
827 // Using a lookup cache adds a slight memory overhead, but boosts speed
828 // caching using a static within the method is faster than a class static,
829 // though it's additional memory overhead
830 static $_indexCache = array();
831
832 if (!isset($_indexCache[$pColumnIndex])) {
833 // Determine column string
834 if ($pColumnIndex < 26) {
835 $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
836 } elseif ($pColumnIndex < 702) {
837 $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
838 chr(65 + $pColumnIndex % 26);
839 } else {
840 $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
841 chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
842 chr(65 + $pColumnIndex % 26);
843 }
844 }
845 return $_indexCache[$pColumnIndex];
846 }

Referenced by PHPExcel_Writer_Excel5\_buildWorksheetEschers(), PHPExcel_Writer_HTML\_generateRow(), PHPExcel_Writer_Excel5_Worksheet\_positionImage(), PHPExcel_Calculation\_processTokenStack(), PHPExcel_Reader_Excel5\_readBIFF5CellRangeAddressFixed(), PHPExcel_Reader_Excel5\_readBIFF8CellAddress(), PHPExcel_Reader_Excel5\_readBIFF8CellAddressB(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddress(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddressB(), PHPExcel_Reader_Excel5\_readBIFF8CellRangeAddressFixed(), PHPExcel_Reader_Excel5\_readBlank(), PHPExcel_Reader_Excel5\_readBoolErr(), PHPExcel_Reader_Excel5_Escher\_readClientAnchor(), PHPExcel_Reader_Excel5\_readFormula(), PHPExcel_Reader_Excel5\_readLabel(), PHPExcel_Reader_Excel5\_readLabelSst(), PHPExcel_Reader_Excel5\_readMulBlank(), PHPExcel_Reader_Excel5\_readMulRk(), PHPExcel_Reader_Excel5\_readNumber(), PHPExcel_Reader_Excel5\_readPane(), PHPExcel_Reader_Excel5\_readRk(), PHPExcel_ReferenceHelper\_updateSingleCellReference(), PHPExcel_Worksheet_PageSetup\addPrintAreaByColumnAndRow(), PHPExcel_Style\applyFromArray(), PHPExcel_Calculation_LookupRef\CELL_ADDRESS(), PHPExcel_Worksheet\cellExistsByColumnAndRow(), PHPExcel_Writer_Excel5_Worksheet\close(), PHPExcel_Worksheet_ColumnIterator\current(), PHPExcel_Worksheet\duplicateConditionalStyle(), PHPExcel_Worksheet\duplicateStyle(), PHPExcel_Worksheet\freezePaneByColumnAndRow(), PHPExcel_Worksheet\garbageCollect(), PHPExcel_Writer_HTML\generateSheetData(), PHPExcel_Worksheet\getCellByColumnAndRow(), PHPExcel_Worksheet_AutoFilter\getColumnByOffset(), ilExcel\getColumnCoord(), PHPExcel_Worksheet\getColumnDimensionByColumn(), PHPExcel_Worksheet\getCommentByColumnAndRow(), ilExcel\getCoordByColumnAndRow(), PHPExcel_Shared_Excel5\getDistanceX(), PHPExcel_CachedObjectStorage_CacheBase\getHighestColumn(), PHPExcel_Worksheet\getStyleByColumnAndRow(), PHPExcel_ReferenceHelper\insertNewBefore(), PHPExcel_Worksheet\insertNewColumnBeforeByIndex(), PHPExcel_Worksheet_ColumnIterator\key(), PHPExcel_Worksheet_RowCellIterator\key(), PHPExcel_Reader_CSV\listWorksheetInfo(), PHPExcel_Reader_Excel2003XML\listWorksheetInfo(), PHPExcel_Reader_Excel2007\listWorksheetInfo(), PHPExcel_Reader_Excel5\listWorksheetInfo(), PHPExcel_Reader_Gnumeric\listWorksheetInfo(), PHPExcel_Reader_OOCalc\listWorksheetInfo(), PHPExcel_Reader_SYLK\listWorksheetInfo(), PHPExcel_Reader_Excel2007\load(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), PHPExcel_Reader_OOCalc\loadIntoExisting(), PHPExcel_Reader_SYLK\loadIntoExisting(), PHPExcel_Worksheet\mergeCellsByColumnAndRow(), PHPExcel_Calculation_LookupRef\OFFSET(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), PHPExcel_Worksheet_ColumnIterator\prev(), PHPExcel_Worksheet_RowCellIterator\prev(), PHPExcel_Worksheet\protectCellsByColumnAndRow(), PHPExcel_Worksheet\rangeToArray(), PHPExcel_Worksheet\removeColumn(), PHPExcel_Worksheet\removeColumnByIndex(), PHPExcel_Worksheet_RowCellIterator\resetStart(), PHPExcel_Worksheet\setAutoFilterByColumnAndRow(), PHPExcel_Worksheet\setBreakByColumnAndRow(), PHPExcel_Worksheet_PageSetup\setPrintAreaByColumnAndRow(), PHPExcel_Worksheet\setSelectedCellByColumnAndRow(), PHPExcel_Worksheet\shrinkRangeToFit(), PHPExcel_Worksheet\unmergeCellsByColumnAndRow(), and PHPExcel_Worksheet\unprotectCellsByColumnAndRow().

+ Here is the caller graph for this function:

Field Documentation

◆ $_calculatedValue

PHPExcel_Cell::$_calculatedValue = NULL
private

Definition at line 70 of file Cell.php.

Referenced by getCalculatedValue(), and getOldCalculatedValue().

◆ $_dataType

PHPExcel_Cell::$_dataType
private

Definition at line 77 of file Cell.php.

Referenced by getDataType().

◆ $_formulaAttributes

PHPExcel_Cell::$_formulaAttributes
private

Attributes of the formula.

Definition at line 97 of file Cell.php.

Referenced by getFormulaAttributes().

◆ $_parent

PHPExcel_Cell::$_parent
private

Definition at line 84 of file Cell.php.

Referenced by getParent().

◆ $_value

PHPExcel_Cell::$_value
private

Definition at line 58 of file Cell.php.

Referenced by getCalculatedValue(), and getValue().

◆ $_valueBinder

PHPExcel_Cell::$_valueBinder = NULL
staticprivate

Definition at line 51 of file Cell.php.

Referenced by getValueBinder().

◆ $_xfIndex

PHPExcel_Cell::$_xfIndex = 0
private

Definition at line 91 of file Cell.php.

Referenced by getXfIndex().

◆ DEFAULT_RANGE

const PHPExcel_Cell::DEFAULT_RANGE = 'A1:A1'

Definition at line 44 of file Cell.php.

Referenced by getRangeBoundaries(), rangeBoundaries(), and splitRange().


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