PHPExcel_Cell

category PHPExcel
package PHPExcel_Cell
copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

 Methods

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

__clone() 

Create a new Cell

__construct(mixed $pValue, string $pDataType, \PHPExcel_Worksheet $pSheet) 

Parameters

$pValue

mixed

$pDataType

string

Exceptions

\PHPExcel_Exception

Convert to string

__toString() : string

Returns

string

Make string coordinate absolute

absoluteCoordinate(string $pCoordinateString) : string
Static

Parameters

$pCoordinateString

string

e.g. 'A1'

Exceptions

\PHPExcel_Exception

Returns

stringAbsolute coordinate e.g. '$A$1'

Make string row, column or cell coordinate absolute

absoluteReference(string $pCoordinateString) : string
Static

Parameters

$pCoordinateString

string

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

Exceptions

\PHPExcel_Exception

Returns

stringAbsolute coordinate e.g. '$A' or '$1' or '$A$1'

attach()

attach(\PHPExcel_CachedObjectStorage_CacheBase $parent) 

Parameters

$parent

Build range from coordinate strings

buildRange(array $pRange) : string
Static

Parameters

$pRange

array

Array containg one or more arrays containing one or two coordinate strings

Exceptions

\PHPExcel_Exception

Returns

stringString representation of $pRange

Column index from string

columnIndexFromString(string $pString) : int
Static

Parameters

$pString

string

Returns

intColumn index (base 1 !!!)

Compare 2 cells

compareCells(\PHPExcel_Cell $a, \PHPExcel_Cell $b) : int
Static

Parameters

$a

\PHPExcel_Cell

Cell a

$b

\PHPExcel_Cell

Cell b

Returns

intResult of comparison (always -1 or 1, never zero!)

Coordinate from string

coordinateFromString(string $pCoordinateString) : array
Static

Parameters

$pCoordinateString

string

Exceptions

\PHPExcel_Exception

Returns

arrayArray containing column and row (indexes 0 and 1)

detach()

detach() 

Extract all cell references in range

extractAllCellReferencesInRange(string $pRange) : array
Static

Parameters

$pRange

string

Range (e.g. A1 or A1:C10 or A1:E10 A20:E25)

Returns

arrayArray containing single cell references

Get calculated cell value

getCalculatedValue(boolean $resetLog) : mixed
deprecated Since version 1.7.8 for planned changes to cell for array formula handling

Parameters

$resetLog

boolean

Whether the calculation engine logger should be reset or not

Exceptions

\PHPExcel_Exception

Returns

mixed

Get cell coordinate column

getColumn() : string

Returns

string

Get cell coordinate

getCoordinate() : string

Returns

string

Get cell data type

getDataType() : string

Returns

string

Get Data validation rules

getDataValidation() : \PHPExcel_Cell_DataValidation

Get cell value with formatting

getFormattedValue() : string

Returns

string

getFormulaAttributes()

getFormulaAttributes() 
deprecated Since version 1.7.8 for planned changes to cell for array formula handling

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.

getOldCalculatedValue() : mixed

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

Calculate range boundaries

getRangeBoundaries(string $pRange) : array
Static

Parameters

$pRange

string

Cell range (e.g. A1:A1)

Returns

arrayRange coordinates array(Start Cell, End Cell) where Start Cell and End Cell are arrays (Column ID, Row Number)

Get cell coordinate row

getRow() : int

Returns

int

Get cell style

getStyle() : \PHPExcel_Style

Returns

Get cell value

getValue() : mixed

Returns

mixed

Get value binder to use

getValueBinder() : \PHPExcel_Cell_IValueBinder
Static

Get parent worksheet

getWorksheet() : \PHPExcel_Worksheet

Get index to cellXf

getXfIndex() : int

Returns

int

Does this cell contain Data validation rules?

hasDataValidation() : boolean

Exceptions

\PHPExcel_Exception

Returns

boolean

Identify if the cell contains a formula

isFormula() 

@return boolean

Is cell in a specific range?

isInRange(string $pRange) : boolean

Parameters

$pRange

string

Cell range (e.g. A1:A1)

Returns

boolean

Send notification to the cache controller

notifyCacheController() : void

Calculate range boundaries

rangeBoundaries(string $pRange) : array
Static

Parameters

$pRange

string

Cell range (e.g. A1:A1)

Returns

arrayRange coordinates array(Start Cell, End Cell) where Start Cell and End Cell are arrays (Column Number, Row Number)

Calculate range dimension

rangeDimension(string $pRange) : array
Static

Parameters

$pRange

string

Cell range (e.g. A1:A1)

Returns

arrayRange dimension (width, height)

Re-bind parent

rebindParent(\PHPExcel_Worksheet $parent) : \PHPExcel_Cell

Parameters

Returns

Set old calculated value (cached)

setCalculatedValue(mixed $pValue) : \PHPExcel_Cell

Parameters

$pValue

mixed

Value

Returns

Set cell data type

setDataType(string $pDataType) : \PHPExcel_Cell

Parameters

$pDataType

string

Returns

Set Data validation rules

setDataValidation(\PHPExcel_Cell_DataValidation $pDataValidation) : \PHPExcel_Cell

Parameters

Exceptions

\PHPExcel_Exception

Returns

setFormulaAttributes()

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

Parameters

$pAttributes

Set cell value

setValue(mixed $pValue) : \PHPExcel_Cell

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

Parameters

$pValue

mixed

Value

Exceptions

\PHPExcel_Exception

Returns

Set value binder to use

setValueBinder(\PHPExcel_Cell_IValueBinder $binder) 
Static

Parameters

Exceptions

\PHPExcel_Exception

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

setValueExplicit(mixed $pValue, string $pDataType) : \PHPExcel_Cell

Parameters

$pValue

mixed

Value

$pDataType

string

Explicit data type

Exceptions

\PHPExcel_Exception

Returns

Set index to cellXf

setXfIndex(int $pValue) : \PHPExcel_Cell

Parameters

$pValue

int

Returns

Split range into coordinate strings

splitRange(string $pRange) : array
Static

Parameters

$pRange

string

e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'

Returns

arrayArray 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')

String from columnindex

stringFromColumnIndex(int $pColumnIndex) : string
Static

Parameters

$pColumnIndex

int

Column index (base 0 !!!)

Returns

string

 Properties

 

$_calculatedValue : mixed

Note that this value is not guaranteed to reflect 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.

 

$_dataType : string
 

$_formulaAttributes 
   

$_value : mixed
 

$_valueBinder : \PHPExcel_Cell_IValueBinder
 

$_xfIndex : int

 Constants

 

Default range variable constant

DEFAULT_RANGE 

@var string