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 : int

Index to cellXf

Type

int

$_formulaAttributes

$_formulaAttributes

Attributes of the formula

Methods

notifyCacheController()

notifyCacheController() : void

Send notification to the cache controller

detach()

detach() : mixed

Returns

mixed —

attach()

attach(\PHPExcel_CachedObjectStorage_CacheBase  $parent) : mixed

Parameters

\PHPExcel_CachedObjectStorage_CacheBase $parent

Returns

mixed —

__construct()

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

Create a new Cell

Parameters

mixed $pValue
string $pDataType
\PHPExcel_Worksheet $pSheet

Throws

\PHPExcel_Exception

Returns

mixed —

getColumn()

getColumn() : string

Get cell coordinate column

Returns

string —

getRow()

getRow() : int

Get cell coordinate row

Returns

int —

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(bool  $resetLog = TRUE) : mixed

Get calculated cell value

Parameters

bool $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 —

isFormula()

isFormula() : mixed

Identify if the cell contains a formula

@return boolean

Returns

mixed —

hasDataValidation()

hasDataValidation() : bool

Does this cell contain Data validation rules?

Throws

\PHPExcel_Exception

Returns

bool —

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() : bool

Does this cell contain a Hyperlink?

Throws

\PHPExcel_Exception

Returns

bool —

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_CachedObjectStorage_CacheBase

Get parent worksheet

Returns

\PHPExcel_CachedObjectStorage_CacheBase —

getWorksheet()

getWorksheet() : \PHPExcel_Worksheet

Get parent worksheet

Returns

\PHPExcel_Worksheet —

getStyle()

getStyle() : \PHPExcel_Style

Get cell style

Returns

\PHPExcel_Style —

rebindParent()

rebindParent(\PHPExcel_Worksheet  $parent) : \PHPExcel_Cell

Re-bind parent

Parameters

\PHPExcel_Worksheet $parent

Returns

\PHPExcel_Cell —

isInRange()

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

Is cell in a specific range?

Parameters

string $pRange

Cell range (e.g. A1:A1)

Returns

bool —

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') : int

Column index from string

Parameters

string $pString

Returns

int —

Column index (base 1 !!!)

stringFromColumnIndex()

stringFromColumnIndex(int  $pColumnIndex) : string

String from columnindex

Parameters

int $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) : int

Compare 2 cells

Parameters

\PHPExcel_Cell $a

Cell a

\PHPExcel_Cell $b

Cell b

Returns

int —

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

getValueBinder()

getValueBinder() : \PHPExcel_Cell_IValueBinder

Get value binder to use

Returns

\PHPExcel_Cell_IValueBinder —

setValueBinder()

setValueBinder(\PHPExcel_Cell_IValueBinder  $binder = NULL) : mixed

Set value binder to use

Parameters

\PHPExcel_Cell_IValueBinder $binder

Throws

\PHPExcel_Exception

Returns

mixed —

__clone()

__clone() : mixed

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

Returns

mixed —

getXfIndex()

getXfIndex() : int

Get index to cellXf

Returns

int —

setXfIndex()

setXfIndex(int  $pValue) : \PHPExcel_Cell

Set index to cellXf

Parameters

int $pValue

Returns

\PHPExcel_Cell —

setFormulaAttributes()

setFormulaAttributes(mixed  $pAttributes) : mixed

Parameters

mixed $pAttributes

Returns

mixed —

getFormulaAttributes()

getFormulaAttributes() : mixed

Returns

mixed —

__toString()

__toString() : string

Convert to string

Returns

string —