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.

References PHPExcel_Cell_DataType\TYPE_STRING, and PHPExcel_Cell_DataType\TYPE_STRING2.

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

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.

References getValue().

1017  {
1018  return (string) $this->getValue();
1019  }
getValue()
Get cell value.
Definition: Cell.php:181
+ 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.

References $column, $row, and $worksheet.

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  }
$worksheet
$column
Definition: 39dropdown.php:62

◆ 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.

References $worksheet.

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  }
$worksheet

◆ 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.

References $counter, and array.

Referenced by PHPExcel_ReferenceHelper\_updateCellRange().

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
Create styles array
The data for the language used.
+ 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.

References array.

Referenced by PHPExcel_Worksheet_ColumnCellIterator\__construct(), PHPExcel_Writer_Excel5_Worksheet\__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_Excel2007_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel5_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(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), PHPExcel_Reader_OOCalc\loadIntoExisting(), PHPExcel_Calculation_LookupRef\OFFSET(), PHPExcel_Shared_Excel5\oneAnchor2twoAnchor(), PHPExcel_Worksheet\removeColumn(), PHPExcel_Worksheet_RowCellIterator\resetEnd(), PHPExcel_Worksheet_ColumnIterator\resetEnd(), PHPExcel_Worksheet_RowCellIterator\resetStart(), PHPExcel_Worksheet_ColumnIterator\resetStart(), PHPExcel_Worksheet_RowCellIterator\seek(), PHPExcel_Worksheet_ColumnIterator\seek(), PHPExcel_Worksheet_AutoFilter\setRange(), PHPExcel_Worksheet\shrinkRangeToFit(), PHPExcel_Worksheet_AutoFilter\testColumnInRange(), and PHPExcel_ReferenceHelper\updateFormulaReferences().

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  }
Create styles array
The data for the language used.
+ 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.

References getColumn(), and getRow().

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  }
getColumn()
Get cell coordinate column.
Definition: Cell.php:151
getRow()
Get cell coordinate row.
Definition: Cell.php:161
+ 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.

References array.

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_Excel2007_Worksheet\_writeBreaks(), PHPExcel_Writer_Excel5_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(), 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(), and PHPExcel_ReferenceHelper\updateFormulaReferences().

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  }
Create styles array
The data for the language used.
+ 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.

References $column, $row, and array.

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().

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  }
$column
Definition: 39dropdown.php:62
Create styles array
The data for the language used.
+ 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.

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

Referenced by getFormattedValue().

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
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
$_calculatedValue
Definition: Cell.php:70
static getInstance(PHPExcel $workbook=NULL)
Get an instance of this class.
getParent()
Get parent worksheet.
Definition: Cell.php:479
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

Referenced by compareCells(), and isInRange().

152  {
153  return $this->_parent->getCurrentColumn();
154  }
+ 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.

References $_dataType.

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

◆ getDataValidation()

PHPExcel_Cell::getDataValidation ( )

Get Data validation rules.

Returns
PHPExcel_Cell_DataValidation
Exceptions
PHPExcel_Exception

Definition at line 399 of file Cell.php.

References getCoordinate(), and getWorksheet().

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  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

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

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

References $_formulaAttributes.

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

◆ getHyperlink()

PHPExcel_Cell::getHyperlink ( )

Get Hyperlink.

Returns
PHPExcel_Cell_Hyperlink
Exceptions
PHPExcel_Exception

Definition at line 447 of file Cell.php.

References getCoordinate(), and getWorksheet().

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  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

References getWorksheet(), and isInRange().

Referenced by isInMergeRange(), and isMergeRangeValueCell().

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
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

References $_calculatedValue.

338  {
340  }
$_calculatedValue
Definition: Cell.php:70

◆ getParent()

PHPExcel_Cell::getParent ( )

Get parent worksheet.

Returns
PHPExcel_CachedObjectStorage_CacheBase

Definition at line 479 of file Cell.php.

References $_parent.

Referenced by getCalculatedValue().

479  {
480  return $this->_parent;
481  }
+ 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.

References array.

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

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  }
+ 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.

Referenced by compareCells(), and isInRange().

162  {
163  return $this->_parent->getCurrentRow();
164  }
+ 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.

References getCoordinate(), and getWorksheet().

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

537  {
538  return $this->getWorksheet()->getStyle($this->getCoordinate());
539  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

References $_value.

Referenced by __toString().

182  {
183  return $this->_value;
184  }
+ 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  }

◆ getWorksheet()

PHPExcel_Cell::getWorksheet ( )

Get parent worksheet.

Returns
PHPExcel_Worksheet

Definition at line 488 of file Cell.php.

Referenced by PHPExcel_Cell_AdvancedValueBinder\bindValue(), getCalculatedValue(), getDataValidation(), getHyperlink(), getMergeRange(), getStyle(), hasDataValidation(), hasHyperlink(), PHPExcel_Shared_Date\isDateTime(), setDataValidation(), setHyperlink(), and PHPExcel_Writer_OpenDocument_Cell_Comment\write().

488  {
489  return $this->_parent->getParent();
490  }
+ Here is the caller graph for this function:

◆ getXfIndex()

PHPExcel_Cell::getXfIndex ( )

Get index to cellXf.

Returns
int

Definition at line 976 of file Cell.php.

References $_xfIndex.

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

◆ hasDataValidation()

PHPExcel_Cell::hasDataValidation ( )

Does this cell contain Data validation rules?

Returns
boolean
Exceptions
PHPExcel_Exception

Definition at line 384 of file Cell.php.

References getCoordinate(), and getWorksheet().

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  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

References getCoordinate(), and getWorksheet().

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  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

References PHPExcel_Cell_DataType\TYPE_FORMULA.

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

◆ isInMergeRange()

PHPExcel_Cell::isInMergeRange ( )

Is this cell in a merge range.

Returns
boolean

Definition at line 497 of file Cell.php.

References getMergeRange().

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

References getColumn(), and getRow().

Referenced by getMergeRange().

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  }
+ 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.

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

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  }
static splitRange($pRange='A1:A1')
Split range into coordinate strings.
Definition: Cell.php:660
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
getMergeRange()
If this cell is in a merge range, then return the range.
Definition: Cell.php:522
+ 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.

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

105  {
106  $this->_parent->updateCacheData($this);
107 
108  return $this;
109  }
+ 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.

References array.

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

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  }
+ 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.

References array.

Referenced by PHPExcel_Chart_DataSeriesValues\refresh().

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  }
+ 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.

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

547  {
548  $this->_parent = $parent->getCellCacheController();
549 
550  return $this->notifyCacheController();
551  }
getCellCacheController()
Return the cache controller for the cell collection.
Definition: Worksheet.php:413
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
+ 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.

References notifyCacheController().

319  {
320  if ($pValue !== NULL) {
321  $this->_calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
322  }
323 
324  return $this->notifyCacheController();
325  }
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
+ 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.

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

359  {
360  if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2)
362 
363  $this->_dataType = $pDataType;
364 
365  return $this->notifyCacheController();
366  }
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
+ 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.

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

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  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

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

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  }
getCoordinate()
Get cell coordinate.
Definition: Cell.php:171
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
getWorksheet()
Get parent worksheet.
Definition: Cell.php:488
+ 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.

References PHPExcel_Cell_DataType\checkErrorCode(), PHPExcel_Cell_DataType\checkString(), notifyCacheController(), string, 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().

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  }
Add rich text string
The name of the decorator.
static checkString($pValue=null)
Check a string that it satisfies Excel requirements.
Definition: DataType.php:89
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
static checkErrorCode($pValue=null)
Check a value that it is a valid error code.
Definition: DataType.php:111
+ 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.

References notifyCacheController().

988  {
989  $this->_xfIndex = $pValue;
990 
991  return $this->notifyCacheController();
992  }
notifyCacheController()
Send notification to the cache controller.
Definition: Cell.php:105
+ 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.

References $counter.

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(), PHPExcel_Calculation\extractNamedRange(), isMergeRangeValueCell(), and PHPExcel_Worksheet\setSelectedCells().

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  }
+ 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.

References array.

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_RowCellIterator\key(), PHPExcel_Worksheet_ColumnIterator\key(), PHPExcel_Reader_SYLK\listWorksheetInfo(), PHPExcel_Reader_Gnumeric\listWorksheetInfo(), PHPExcel_Reader_Excel2003XML\listWorksheetInfo(), PHPExcel_Reader_Excel2007\listWorksheetInfo(), PHPExcel_Reader_CSV\listWorksheetInfo(), PHPExcel_Reader_OOCalc\listWorksheetInfo(), PHPExcel_Reader_Excel5\listWorksheetInfo(), PHPExcel_Reader_Excel2007\load(), PHPExcel_Reader_SYLK\loadIntoExisting(), PHPExcel_Reader_Gnumeric\loadIntoExisting(), PHPExcel_Reader_Excel2003XML\loadIntoExisting(), PHPExcel_Reader_OOCalc\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().

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  }
Create styles array
The data for the language used.
+ 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.

◆ $_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.


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