Constants

DEFAULT_RANGE

DEFAULT_RANGE = 'A1:A1'

Default range variable constant

@var string

Properties

$_value

$_value : mixed

Value of the cell

Type

mixed

$_calculatedValue

$_calculatedValue : mixed

Calculated value of the cell (used for caching) 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 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.

Type

mixed

$_dataType

$_dataType : string

Type of the cell data

Type

string

$_xfIndex

$_xfIndex : integer

Index to cellXf

Type

integer

$_formulaAttributes

$_formulaAttributes : 

Attributes of the formula

Type

Methods

notifyCacheController()

notifyCacheController() : void

Send notification to the cache controller

detach()

detach() 

__construct()

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

Create a new Cell

Parameters

mixed $pValue
string $pDataType
\PHPExcel_Worksheet $pSheet

Throws

\PHPExcel_Exception

getColumn()

getColumn() : string

Get cell coordinate column

Returns

string

getRow()

getRow() : integer

Get cell coordinate row

Returns

integer

getCoordinate()

getCoordinate() : string

Get cell coordinate

Returns

string

getValue()

getValue() : mixed

Get cell value

Returns

mixed

getFormattedValue()

getFormattedValue() : string

Get cell value with formatting

Returns

string

setValue()

setValue(mixed  $pValue = NULL) : \PHPExcel_Cell

Set cell value

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

Parameters

mixed $pValue

Value

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Cell

setValueExplicit()

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

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

Parameters

mixed $pValue

Value

string $pDataType

Explicit data type

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Cell

getCalculatedValue()

getCalculatedValue(boolean  $resetLog = TRUE) : mixed

Get calculated cell value

Parameters

boolean $resetLog

Whether the calculation engine logger should be reset or not

Throws

\PHPExcel_Exception

Returns

mixed

setCalculatedValue()

setCalculatedValue(mixed  $pValue = NULL) : \PHPExcel_Cell

Set old calculated value (cached)

Parameters

mixed $pValue

Value

Returns

\PHPExcel_Cell

getOldCalculatedValue()

getOldCalculatedValue() : mixed

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

getDataType()

getDataType() : string

Get cell data type

Returns

string

setDataType()

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

Set cell data type

Parameters

string $pDataType

Returns

\PHPExcel_Cell

hasDataValidation()

hasDataValidation() : boolean

Does this cell contain Data validation rules?

Throws

\PHPExcel_Exception

Returns

boolean

getDataValidation()

getDataValidation() : \PHPExcel_Cell_DataValidation

Get Data validation rules

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Cell_DataValidation

setDataValidation()

setDataValidation(\PHPExcel_Cell_DataValidation  $pDataValidation = NULL) : \PHPExcel_Cell

Set Data validation rules

Parameters

\PHPExcel_Cell_DataValidation $pDataValidation

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Cell

hasHyperlink()

hasHyperlink() : boolean

Does this cell contain a Hyperlink?

Throws

\PHPExcel_Exception

Returns

boolean

getHyperlink()

getHyperlink() : \PHPExcel_Cell_Hyperlink

Get Hyperlink

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Cell_Hyperlink

setHyperlink()

setHyperlink(\PHPExcel_Cell_Hyperlink  $pHyperlink = NULL) : \PHPExcel_Cell

Set Hyperlink

Parameters

\PHPExcel_Cell_Hyperlink $pHyperlink

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Cell

getParent()

getParent() : \PHPExcel_Worksheet

Get parent worksheet

Returns

\PHPExcel_Worksheet

getWorksheet()

getWorksheet() : \PHPExcel_Worksheet

Get parent worksheet

Returns

\PHPExcel_Worksheet

getStyle()

getStyle() : \PHPExcel_Style

Get cell style

Returns

\PHPExcel_Style

isInRange()

isInRange(string  $pRange = 'A1:A1') : boolean

Is cell in a specific range?

Parameters

string $pRange

Cell range (e.g. A1:A1)

Returns

boolean

coordinateFromString()

coordinateFromString(string  $pCoordinateString = 'A1') : array

Coordinate from string

Parameters

string $pCoordinateString

Throws

\PHPExcel_Exception

Returns

array —

Array containing column and row (indexes 0 and 1)

absoluteReference()

absoluteReference(string  $pCoordinateString = 'A1') : string

Make string row, column or cell coordinate absolute

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

Throws

\PHPExcel_Exception

Returns

string —

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

absoluteCoordinate()

absoluteCoordinate(string  $pCoordinateString = 'A1') : string

Make string coordinate absolute

Parameters

string $pCoordinateString

e.g. 'A1'

Throws

\PHPExcel_Exception

Returns

string —

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

splitRange()

splitRange(string  $pRange = 'A1:A1') : array

Split range into coordinate strings

Parameters

string $pRange

e.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')

buildRange()

buildRange(array  $pRange) : string

Build range from coordinate strings

Parameters

array $pRange

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

Throws

\PHPExcel_Exception

Returns

string —

String representation of $pRange

rangeBoundaries()

rangeBoundaries(string  $pRange = 'A1:A1') : array

Calculate range boundaries

Parameters

string $pRange

Cell 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)

rangeDimension()

rangeDimension(string  $pRange = 'A1:A1') : array

Calculate range dimension

Parameters

string $pRange

Cell range (e.g. A1:A1)

Returns

array —

Range dimension (width, height)

getRangeBoundaries()

getRangeBoundaries(string  $pRange = 'A1:A1') : array

Calculate range boundaries

Parameters

string $pRange

Cell 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)

columnIndexFromString()

columnIndexFromString(string  $pString = 'A') : integer

Column index from string

Parameters

string $pString

Returns

integer —

Column index (base 1 !!!)

stringFromColumnIndex()

stringFromColumnIndex(integer  $pColumnIndex) : string

String from columnindex

Parameters

integer $pColumnIndex

Column index (base 0 !!!)

Returns

string

extractAllCellReferencesInRange()

extractAllCellReferencesInRange(string  $pRange = 'A1') : array

Extract all cell references in range

Parameters

string $pRange

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

Returns

array —

Array containing single cell references

compareCells()

compareCells(\PHPExcel_Cell  $a, \PHPExcel_Cell  $b) : integer

Compare 2 cells

Parameters

\PHPExcel_Cell $a

Cell a

\PHPExcel_Cell $b

Cell b

Returns

integer —

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

setValueBinder()

setValueBinder(\PHPExcel_Cell_IValueBinder  $binder = NULL) 

Set value binder to use

Parameters

\PHPExcel_Cell_IValueBinder $binder

Throws

\PHPExcel_Exception

__clone()

__clone() 

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

getXfIndex()

getXfIndex() : integer

Get index to cellXf

Returns

integer

setXfIndex()

setXfIndex(integer  $pValue) : \PHPExcel_Cell

Set index to cellXf

Parameters

integer $pValue

Returns

\PHPExcel_Cell

setFormulaAttributes()

setFormulaAttributes(  $pAttributes) 

Parameters

$pAttributes

getFormulaAttributes()

getFormulaAttributes() 

__toString()

__toString() : string

Convert to string

Returns

string