Properties

$valueBinder

$valueBinder : \PhpOffice\PhpSpreadsheet\Cell\IValueBinder

Value binder to use.

Type

IValueBinder

$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

$parent

$parent : \PhpOffice\PhpSpreadsheet\Collection\Cells

Collection of cells.

Type

Cells

$xfIndex

$xfIndex : int

Index to cellXf.

Type

int

$formulaAttributes

$formulaAttributes

Attributes of the formula.

Methods

updateInCollection()

updateInCollection() : self

Update the cell into the cell collection.

Returns

self —

detach()

detach() : mixed

Returns

mixed —

attach()

attach(\PhpOffice\PhpSpreadsheet\Collection\Cells  $parent) : mixed

Parameters

\PhpOffice\PhpSpreadsheet\Collection\Cells $parent

Returns

mixed —

__construct()

__construct(mixed  $pValue, string  $pDataType, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $pSheet) : mixed

Create a new Cell.

Parameters

mixed $pValue
string $pDataType
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet

Throws

\PhpOffice\PhpSpreadsheet\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) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set cell value.

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

Parameters

mixed $pValue

Value

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

setValueExplicit()

setValueExplicit(mixed  $pValue, string  $pDataType) : \PhpOffice\PhpSpreadsheet\Cell\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, see DataType::TYPE_*

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

\PhpOffice\PhpSpreadsheet\Cell\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

\PhpOffice\PhpSpreadsheet\Exception

Returns

mixed —

setCalculatedValue()

setCalculatedValue(mixed  $pValue) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set old calculated value (cached).

Parameters

mixed $pValue

Value

Returns

\PhpOffice\PhpSpreadsheet\Cell\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 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.

Returns

mixed —

getDataType()

getDataType() : string

Get cell data type.

Returns

string —

setDataType()

setDataType(string  $pDataType) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set cell data type.

Parameters

string $pDataType

see DataType::TYPE_*

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

isFormula()

isFormula() : bool

Identify if the cell contains a formula.

Returns

bool —

hasDataValidation()

hasDataValidation() : bool

Does this cell contain Data validation rules?

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

bool —

getDataValidation()

getDataValidation() : \PhpOffice\PhpSpreadsheet\Cell\DataValidation

Get Data validation rules.

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

\PhpOffice\PhpSpreadsheet\Cell\DataValidation —

setDataValidation()

setDataValidation(\PhpOffice\PhpSpreadsheet\Cell\DataValidation  $pDataValidation = null) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set Data validation rules.

Parameters

\PhpOffice\PhpSpreadsheet\Cell\DataValidation $pDataValidation

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

hasValidValue()

hasValidValue() : bool

Does this cell contain valid value?

Returns

bool —

hasHyperlink()

hasHyperlink() : bool

Does this cell contain a Hyperlink?

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

bool —

getHyperlink()

getHyperlink() : \PhpOffice\PhpSpreadsheet\Cell\Hyperlink

Get Hyperlink.

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

\PhpOffice\PhpSpreadsheet\Cell\Hyperlink —

setHyperlink()

setHyperlink(\PhpOffice\PhpSpreadsheet\Cell\Hyperlink  $pHyperlink = null) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set Hyperlink.

Parameters

\PhpOffice\PhpSpreadsheet\Cell\Hyperlink $pHyperlink

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

getParent()

getParent() : \PhpOffice\PhpSpreadsheet\Collection\Cells

Get cell collection.

Returns

\PhpOffice\PhpSpreadsheet\Collection\Cells —

getWorksheet()

getWorksheet() : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Get parent worksheet.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet —

isInMergeRange()

isInMergeRange() : bool

Is this cell in a merge range.

Returns

bool —

isMergeRangeValueCell()

isMergeRangeValueCell() : bool

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

Returns

bool —

getMergeRange()

getMergeRange() : false|string

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

Returns

false|string —

getStyle()

getStyle() : \PhpOffice\PhpSpreadsheet\Style\Style

Get cell style.

Returns

\PhpOffice\PhpSpreadsheet\Style\Style —

rebindParent()

rebindParent(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $parent) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Re-bind parent.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $parent

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

isInRange()

isInRange(string  $pRange) : bool

Is cell in a specific range?

Parameters

string $pRange

Cell range (e.g. A1:A1)

Returns

bool —

compareCells()

compareCells(\PhpOffice\PhpSpreadsheet\Cell\Cell  $a, \PhpOffice\PhpSpreadsheet\Cell\Cell  $b) : int

Compare 2 cells.

Parameters

\PhpOffice\PhpSpreadsheet\Cell\Cell $a

Cell a

\PhpOffice\PhpSpreadsheet\Cell\Cell $b

Cell b

Returns

int —

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

getValueBinder()

getValueBinder() : \PhpOffice\PhpSpreadsheet\Cell\IValueBinder

Get value binder to use.

Returns

\PhpOffice\PhpSpreadsheet\Cell\IValueBinder —

setValueBinder()

setValueBinder(\PhpOffice\PhpSpreadsheet\Cell\IValueBinder  $binder) : mixed

Set value binder to use.

Parameters

\PhpOffice\PhpSpreadsheet\Cell\IValueBinder $binder

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) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set index to cellXf.

Parameters

int $pValue

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

setFormulaAttributes()

setFormulaAttributes(mixed  $pAttributes) : \PhpOffice\PhpSpreadsheet\Cell\Cell

Set the formula attributes.

Parameters

mixed $pAttributes

Returns

\PhpOffice\PhpSpreadsheet\Cell\Cell —

getFormulaAttributes()

getFormulaAttributes() : mixed

Get the formula attributes.

Returns

mixed —

__toString()

__toString() : string

Convert to string.

Returns

string —