PHPExcel_Cell

# Class: PHPExcel_Cell

Source Location: /PHPExcel/Cell.php

### Class Overview

PHPExcel_Cell

#### Author(s):

#### Copyright:

- Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

### Constants

- DEFAULT_RANGE

### Methods

- __construct
- absoluteCoordinate
- absoluteReference
- attach
- buildRange
- columnIndexFromString
- compareCells
- coordinateFromString
- detach
- extractAllCellReferencesInRange
- getCalculatedValue
- getColumn
- getCoordinate
- getDataType
- getDataValidation
- getFormattedValue
- getFormulaAttributes
- getHyperlink
- getOldCalculatedValue
- getParent
- getRangeBoundaries
- getRow
- getValue
- getValueBinder
- getXfIndex
- hasDataValidation
- hasHyperlink
- isInRange
- notifyCacheController
- rangeBoundaries
- rangeDimension
- rebindParent
- setCalculatedValue
- setDataType
- setDataValidation
- setFormulaAttributes
- setHyperlink
- setValue
- setValueBinder
- setValueExplicit
- setXfIndex
- splitRange
- stringFromColumnIndex
- __clone
- __toString

### Class Details

[line 36]
PHPExcel_Cell

#### Tags:

copyright: | Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

[ Top ]

### Class Methods

### static method absoluteCoordinate [line 580]

`static string absoluteCoordinate( [string $pCoordinateString = 'A1'])`

Make string coordinate absolute

#### Tags:

return: | Absolute coordinate e.g. '$A$1'
throws: | PHPExcel_Exception
access: | public

#### Parameters:

string | $pCoordinateString | e.g. 'A1'

[ Top ]

### static method absoluteReference [line 550]

`static string absoluteReference( [string $pCoordinateString = 'A1'])`

Make string row, column or cell coordinate absolute

#### Tags:

return: | Absolute coordinate e.g. '$A' or '$1' or '$A$1'
throws: | PHPExcel_Exception
access: | public

#### Parameters:

string | $pCoordinateString | e.g. 'A' or '1' or 'A1' Note that this value can be a row or column reference as well as a cell reference

[ Top ]

### static method buildRange [line 631]

`static string buildRange( array $pRange)`

Build range from coordinate strings

#### Tags:

return: | String representation of $pRange
throws: | PHPExcel_Exception
access: | public

#### Parameters:

array | $pRange | Array containg one or more arrays containing one or two coordinate strings

[ Top ]

### static method columnIndexFromString [line 732]

`static int columnIndexFromString( [string $pString = 'A'])`

Column index from string

#### Tags:

return: | Column index (base 1 !!!)
throws: | Exception
access: | public

#### Parameters:

string | $pString |

[ Top ]

### static method compareCells [line 867]

`static int compareCells( PHPExcel_Cell $a, PHPExcel_Cell $b)`

Compare 2 cells

#### Tags:

return: | Result of comparison (always -1 or 1, never zero!)
access: | public

#### Parameters:

PHPExcel_Cell | $a | Cell b
PHPExcel_Cell | $b |

[ Top ]

### static method coordinateFromString [line 529]

`static array coordinateFromString( [string $pCoordinateString = 'A1'])`

Coordinate from string

#### Tags:

return: | Array containing column and row (indexes 0 and 1)
throws: | PHPExcel_Exception
access: | public

#### Parameters:

string | $pCoordinateString |

[ Top ]

### static method extractAllCellReferencesInRange [line 804]

`static array extractAllCellReferencesInRange( [string $pRange = 'A1'])`

Extract all cell references in range

#### Tags:

return: | Array containing single cell references
access: | public

#### Parameters:

string | $pRange | Range (e.g. A1 or A1:C10 or A1:E10 A20:E25)

[ Top ]

### static method getRangeBoundaries [line 705]

`static array getRangeBoundaries( [string $pRange = 'A1:A1'])`

Calculate range boundaries

#### Tags:

return: | Range coordinates array(Start Cell, End Cell) where Start Cell and End Cell are arrays (Column ID, Row Number)
access: | public

#### Parameters:

string | $pRange | Cell range (e.g. A1:A1)

[ Top ]

### static method getValueBinder [line 885]

`static PHPExcel_Cell_IValueBinder getValueBinder( )`

Get value binder to use

#### Tags:

access: | public

[ Top ]

### static method rangeBoundaries [line 656]

`static array rangeBoundaries( [string $pRange = 'A1:A1'])`

Calculate range boundaries

#### Tags:

return: | Range coordinates array(Start Cell, End Cell) where Start Cell and End Cell are arrays (Column Number, Row Number)
access: | public

#### Parameters:

string | $pRange | Cell range (e.g. A1:A1)

[ Top ]

### static method rangeDimension [line 690]

`static array rangeDimension( [string $pRange = 'A1:A1'])`

Calculate range dimension

#### Tags:

return: | Range dimension (width, height)
access: | public

#### Parameters:

string | $pRange | Cell range (e.g. A1:A1)

[ Top ]

### static method setValueBinder [line 899]

`static void setValueBinder( [PHPExcel_Cell_IValueBinder $binder = NULL])`

Set value binder to use

#### Tags:

throws: | Exception
access: | public

#### Parameters:

PHPExcel_Cell_IValueBinder | $binder |

[ Top ]

### static method splitRange [line 609]

`static array splitRange( [string $pRange = 'A1:A1'])`

Split range into coordinate strings

#### Tags:

return: | 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')
access: | public

#### Parameters:

string | $pRange | e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'

[ Top ]

### static method stringFromColumnIndex [line 775]

`static string stringFromColumnIndex( [int $pColumnIndex = 0])`

String from columnindex

#### Tags:

access: | public

#### Parameters:

int | $pColumnIndex | Column index (base 0 !!!)

[ Top ]

### constructor __construct [line 143]

`PHPExcel_Cell __construct( [string $pColumn = 'A'], [int $pRow = 1], [mixed $pValue = NULL], [string $pDataType = NULL], [PHPExcel_Worksheet $pSheet = NULL])`

Create a new Cell

#### Tags:

throws: | PHPExcel_Exception
access: | public

#### Parameters:

string | $pColumn |
int | $pRow |
mixed | $pValue |
string | $pDataType |
PHPExcel_Worksheet | $pSheet |

[ Top ]

### method attach [line 128]

`void attach( $parent)`

#### Tags:

access: | public

#### Parameters:

| $parent |

[ Top ]

### method detach [line 124]

`void detach( )`

#### Tags:

access: | public

[ Top ]

### method getCalculatedValue [line 291]

`mixed getCalculatedValue( [ $resetLog = TRUE])`

Get calculated cell value

#### Tags:

deprecated: | Since version 1.7.8 for planned changes to cell for array formula handling
throws: | PHPExcel_Exception
access: | public

#### Parameters:

| $resetLog |

[ Top ]

### method getColumn [line 175]

`string getColumn( )`

Get cell coordinate column

#### Tags:

access: | public

[ Top ]

### method getCoordinate [line 195]

`string getCoordinate( )`

Get cell coordinate

#### Tags:

access: | public

[ Top ]

### method getDataType [line 364]

`string getDataType( )`

Get cell data type

#### Tags:

access: | public

[ Top ]

### method getDataValidation [line 406]

`PHPExcel_Cell_DataValidation getDataValidation( )`

Get Data validation rules

#### Tags:

throws: | PHPExcel_Exception
access: | public

[ Top ]

### method getFormattedValue [line 215]

`string getFormattedValue( )`

Get cell value with formatting

#### Tags:

access: | public

[ Top ]

### method getFormulaAttributes [line 956]

`void getFormulaAttributes( )`

#### Tags:

deprecated: | Since version 1.7.8 for planned changes to cell for array formula handling
access: | public

[ Top ]

### method getHyperlink [line 454]

`PHPExcel_Cell_Hyperlink getHyperlink( )`

Get Hyperlink

#### Tags:

throws: | PHPExcel_Exception
access: | public

[ Top ]

### method getOldCalculatedValue [line 354]

`mixed 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.

#### Tags:

access: | public

[ Top ]

### method getParent [line 486]

`PHPExcel_Worksheet getParent( )`

Get parent worksheet

#### Tags:

access: | public

[ Top ]

### method getRow [line 185]

`int getRow( )`

Get cell coordinate row

#### Tags:

access: | public

[ Top ]

### method getValue [line 205]

`mixed getValue( )`

Get cell value

#### Tags:

access: | public

[ Top ]

### method getXfIndex [line 926]

`int getXfIndex( )`

Get index to cellXf

#### Tags:

access: | public

[ Top ]

### method hasDataValidation [line 391]

`boolean hasDataValidation( )`

Does this cell contain Data validation rules?

#### Tags:

throws: | PHPExcel_Exception
access: | public

[ Top ]

### method hasHyperlink [line 439]

`boolean hasHyperlink( )`

Does this cell contain a Hyperlink?

#### Tags:

throws: | PHPExcel_Exception
access: | public

[ Top ]

### method isInRange [line 508]

`boolean isInRange( [string $pRange = 'A1:A1'])`

Is cell in a specific range?

#### Tags:

access: | public

#### Parameters:

string | $pRange | Cell range (e.g. A1:A1)

[ Top ]

### method notifyCacheController [line 119]

`void notifyCacheController( )`

Send notification to the cache controller

#### Tags:

access: | public

[ Top ]

### method rebindParent [line 496]

`PHPExcel_Cell rebindParent( PHPExcel_Worksheet $parent)`

Re-bind parent

#### Tags:

access: | public

#### Parameters:

PHPExcel_Worksheet | $parent |

[ Top ]

### method setCalculatedValue [line 335]

`PHPExcel_Cell setCalculatedValue( [mixed $pValue = NULL])`

Set old calculated value (cached)

#### Tags:

access: | public

#### Parameters:

mixed | $pValue | Value

[ Top ]

### method setDataType [line 375]

`PHPExcel_Cell setDataType( [string $pDataType = PHPExcel_Cell_DataType::TYPE_STRING])`

Set cell data type

#### Tags:

access: | public

#### Parameters:

string | $pDataType |

[ Top ]

### method setDataValidation [line 422]

`PHPExcel_Cell setDataValidation( [PHPExcel_Cell_DataValidation $pDataValidation = NULL])`

Set Data validation rules

#### Tags:

throws: | PHPExcel_Exception
access: | public

#### Parameters:

PHPExcel_Cell_DataValidation | $pDataValidation |

[ Top ]

### method setFormulaAttributes [line 947]

`void setFormulaAttributes( $pAttributes)`

#### Tags:

deprecated: | Since version 1.7.8 for planned changes to cell for array formula handling
access: | public

#### Parameters:

| $pAttributes |

[ Top ]

### method setHyperlink [line 470]

`PHPExcel_Cell setHyperlink( [PHPExcel_Cell_Hyperlink $pHyperlink = NULL])`

Set Hyperlink

#### Tags:

throws: | PHPExcel_Exception
access: | public

#### Parameters:

PHPExcel_Cell_Hyperlink | $pHyperlink |

[ Top ]

### method setValue [line 233]

`PHPExcel_Cell setValue( [mixed $pValue = NULL])`

Set cell value

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

#### Tags:

throws: | PHPExcel_Exception
access: | public

#### Parameters:

mixed | $pValue | Value

[ Top ]

### method setValueExplicit [line 249]

`PHPExcel_Cell setValueExplicit( [mixed $pValue = NULL], [string $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)

#### Tags:

throws: | PHPExcel_Exception
access: | public

#### Parameters:

mixed | $pValue | Value
string | $pDataType | Explicit data type

[ Top ]

### method setXfIndex [line 937]

`PHPExcel_Cell setXfIndex( [int $pValue = 0])`

Set index to cellXf

#### Tags:

access: | public

#### Parameters:

int | $pValue |

[ Top ]

### method __clone [line 910]

`void __clone( )`

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

#### Tags:

access: | public

[ Top ]

### method __toString [line 966]

`string __toString( )`

Convert to string

#### Tags:

access: | public

[ Top ]

### Class Constants

#### DEFAULT_RANGE = 'A1:A1'

[line 44]

Default range variable constant
[ Top ]

Documentation generated on Fri, 12 Oct 2012 00:15:21 +0200 by phpDocumentor 1.4.4