Documentation

Cell

Table of Contents

$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.
$dataType  : string
Type of the cell data.
$formulaAttributes  : mixed
Attributes of the formula.
$parent  : Cells
Collection of cells.
$value  : mixed
Value of the cell.
$valueBinder  : IValueBinder
Value binder to use.
$xfIndex  : int
Index to cellXf.
__clone()  : mixed
Implement PHP __clone to create a deep clone, not just a shallow copy.
__construct()  : mixed
Create a new Cell.
__toString()  : string
Convert to string.
attach()  : void
compareCells()  : int
Compare 2 cells.
detach()  : void
getCalculatedValue()  : mixed
Get calculated cell value.
getColumn()  : string
Get cell coordinate column.
getCoordinate()  : string
Get cell coordinate.
getDataType()  : string
Get cell data type.
getDataValidation()  : DataValidation
Get Data validation rules.
getFormattedValue()  : string
Get cell value with formatting.
getFormulaAttributes()  : mixed
Get the formula attributes.
getHyperlink()  : Hyperlink
Get Hyperlink.
getMergeRange()  : false|string
If this cell is in a merge range, then return the range.
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.
getParent()  : Cells
Get cell collection.
getRow()  : int
Get cell coordinate row.
getStyle()  : Style
Get cell style.
getValue()  : mixed
Get cell value.
getValueBinder()  : IValueBinder
Get value binder to use.
getWorksheet()  : Worksheet
Get parent worksheet.
getXfIndex()  : int
Get index to cellXf.
hasDataValidation()  : bool
Does this cell contain Data validation rules?
hasHyperlink()  : bool
Does this cell contain a Hyperlink?
hasValidValue()  : bool
Does this cell contain valid value?
isFormula()  : bool
Identify if the cell contains a formula.
isInMergeRange()  : bool
Is this cell in a merge range.
isInRange()  : bool
Is cell in a specific range?
isMergeRangeValueCell()  : bool
Is this cell the master (top left cell) in a merge range (that holds the actual data value).
rebindParent()  : Cell
Re-bind parent.
setCalculatedValue()  : Cell
Set old calculated value (cached).
setDataType()  : Cell
Set cell data type.
setDataValidation()  : self
Set Data validation rules.
setFormulaAttributes()  : $this
Set the formula attributes.
setHyperlink()  : Cell
Set Hyperlink.
setValue()  : $this
Set cell value.
setValueBinder()  : void
Set value binder to use.
setValueExplicit()  : Cell
Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder).
setXfIndex()  : Cell
Set index to cellXf.
updateInCollection()  : $this
Update the cell into the cell collection.

Properties

$calculatedValue

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.

private mixed $calculatedValue

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

Type of the cell data.

private string $dataType

$formulaAttributes

Attributes of the formula.

private mixed $formulaAttributes

$parent

Collection of cells.

private Cells $parent

$value

Value of the cell.

private mixed $value

$xfIndex

Index to cellXf.

private int $xfIndex = 0

Methods

__clone()

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

public __clone() : mixed
Return values
mixed

__construct()

Create a new Cell.

public __construct(mixed $value, string $dataType, Worksheet $worksheet) : mixed
Parameters
$value : mixed
$dataType : string
$worksheet : Worksheet
Return values
mixed

__toString()

Convert to string.

public __toString() : string
Return values
string

attach()

public attach(Cells $parent) : void
Parameters
$parent : Cells
Return values
void

compareCells()

Compare 2 cells.

public static compareCells(Cell $a, Cell $b) : int
Parameters
$a : Cell

Cell a

$b : Cell

Cell b

Return values
int

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

detach()

public detach() : void
Return values
void

getCalculatedValue()

Get calculated cell value.

public getCalculatedValue([bool $resetLog = true ]) : mixed
Parameters
$resetLog : bool = true

Whether the calculation engine logger should be reset or not

Return values
mixed

getColumn()

Get cell coordinate column.

public getColumn() : string
Return values
string

getCoordinate()

Get cell coordinate.

public getCoordinate() : string
Return values
string

getDataType()

Get cell data type.

public getDataType() : string
Return values
string

getFormattedValue()

Get cell value with formatting.

public getFormattedValue() : string
Return values
string

getFormulaAttributes()

Get the formula attributes.

public getFormulaAttributes() : mixed
Return values
mixed

getMergeRange()

If this cell is in a merge range, then return the range.

public getMergeRange() : false|string
Return values
false|string

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.

public getOldCalculatedValue() : 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.

Return values
mixed

getParent()

Get cell collection.

public getParent() : Cells
Return values
Cells

getRow()

Get cell coordinate row.

public getRow() : int
Return values
int

getStyle()

Get cell style.

public getStyle() : Style
Return values
Style

getValue()

Get cell value.

public getValue() : mixed
Return values
mixed

getXfIndex()

Get index to cellXf.

public getXfIndex() : int
Return values
int

hasDataValidation()

Does this cell contain Data validation rules?

public hasDataValidation() : bool
Return values
bool

Does this cell contain a Hyperlink?

public hasHyperlink() : bool
Return values
bool

hasValidValue()

Does this cell contain valid value?

public hasValidValue() : bool
Return values
bool

isFormula()

Identify if the cell contains a formula.

public isFormula() : bool
Return values
bool

isInMergeRange()

Is this cell in a merge range.

public isInMergeRange() : bool
Return values
bool

isInRange()

Is cell in a specific range?

public isInRange(string $range) : bool
Parameters
$range : string

Cell range (e.g. A1:A1)

Return values
bool

isMergeRangeValueCell()

Is this cell the master (top left cell) in a merge range (that holds the actual data value).

public isMergeRangeValueCell() : bool
Return values
bool

setCalculatedValue()

Set old calculated value (cached).

public setCalculatedValue(mixed $originalValue) : Cell
Parameters
$originalValue : mixed

Value

Return values
Cell

setDataType()

Set cell data type.

public setDataType(string $dataType) : Cell
Parameters
$dataType : string

see DataType::TYPE_*

Return values
Cell

setDataValidation()

Set Data validation rules.

public setDataValidation([DataValidation|null $dataValidation = null ]) : self
Parameters
$dataValidation : DataValidation|null = null
Return values
self

setFormulaAttributes()

Set the formula attributes.

public setFormulaAttributes(mixed $attributes) : $this
Parameters
$attributes : mixed
Return values
$this

Set Hyperlink.

public setHyperlink([Hyperlink|null $hyperlink = null ]) : Cell
Parameters
$hyperlink : Hyperlink|null = null
Return values
Cell

setValue()

Set cell value.

public setValue(mixed $value) : $this

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

Parameters
$value : mixed

Value

Return values
$this

setValueBinder()

Set value binder to use.

public static setValueBinder(IValueBinder $binder) : void
Parameters
$binder : IValueBinder
Return values
void

setValueExplicit()

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

public setValueExplicit(mixed $value, string $dataType) : Cell
Parameters
$value : mixed

Value

$dataType : string

Explicit data type, see DataType::TYPE_*

Return values
Cell

setXfIndex()

Set index to cellXf.

public setXfIndex(int $indexValue) : Cell
Parameters
$indexValue : int
Return values
Cell

updateInCollection()

Update the cell into the cell collection.

public updateInCollection() : $this
Return values
$this

Search results