PHPExcel_Calculation (Multiton)

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

 Methods

__clone implementation.

__clone() 

Cloning should not be allowed in a Singleton!

access public

Exceptions

\PHPExcel_Calculation_Exception

__destruct()

__destruct() 

Parse a cell formula and calculate its value

_calculateFormulaValue(string $formula, string $cellID, \PHPExcel_Cell $pCell) : mixed

Parameters

$formula

string

The formula to parse and calculate

$cellID

string

The ID (e.g. A3) of the cell that we are calculating

$pCell

\PHPExcel_Cell

Cell to calculate

Exceptions

\PHPExcel_Calculation_Exception

Returns

mixed

Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0

_getMatrixDimensions(mixed $matrix) : array
Static

Parameters

$matrix

mixed

&$matrix matrix operand

Returns

arrayAn array comprising the number of rows, and number of columns

_localeFunc()

_localeFunc($function) 
Static

Parameters

$function

_translateFormulaToEnglish()

_translateFormulaToEnglish($formula) 

Parameters

$formula

_translateFormulaToLocale()

_translateFormulaToLocale($formula) 

Parameters

$formula

_translateSeparator()

_translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces) 
Static

Parameters

$fromSeparator

$toSeparator

$formula

$inBraces

Remove quotes used as a wrapper to identify string values

_unwrapResult(mixed $value) : mixed
Static

Parameters

$value

mixed

Returns

mixed

Wrap string values in quotes

_wrapResult(mixed $value) : mixed
Static

Parameters

$value

mixed

Returns

mixed

Calculate cell value (using formula from a cell ID) Retained for backward compatibility

calculate(\PHPExcel_Cell $pCell) : mixed
access public

Parameters

$pCell

\PHPExcel_Cell

Cell to calculate

Exceptions

\PHPExcel_Calculation_Exception

Returns

mixed

Calculate the value of a cell formula

calculateCellValue(\PHPExcel_Cell $pCell, Boolean $resetLog) : mixed
access public

Parameters

$pCell

\PHPExcel_Cell

Cell to calculate

$resetLog

Boolean

Flag indicating whether the debug log should be reset or not

Exceptions

\PHPExcel_Calculation_Exception

Returns

mixed

Calculate the value of a formula

calculateFormula(string $formula, string $cellID, \PHPExcel_Cell $pCell) : mixed

Parameters

$formula

string

Formula to parse

$cellID

string

Address of the cell to calculate

$pCell

\PHPExcel_Cell

Cell to calculate

Exceptions

\PHPExcel_Calculation_Exception

Returns

mixed

Clear calculation cache

clearCalculationCache() 

Clear calculation cache for a specified worksheet

clearCalculationCacheForWorksheet(string $worksheetName) 

Parameters

$worksheetName

string

Disable calculation cache

disableCalculationCache() 

Enable calculation cache

enableCalculationCache() 

Extract range values

extractCellRange(string $pRange, \PHPExcel_Worksheet $pSheet, boolean $resetLog) : mixed

Parameters

$pRange

string

&$pRange String based range representation

$pSheet

\PHPExcel_Worksheet

Worksheet

$resetLog

boolean

Flag indicating whether calculation log should be reset or not

Exceptions

\PHPExcel_Calculation_Exception

Returns

mixedArray of values in range if range contains more than one element. Otherwise, a single value is returned.

Extract range values

extractNamedRange(string $pRange, \PHPExcel_Worksheet $pSheet, boolean $resetLog) : mixed

Parameters

$pRange

string

&$pRange String based range representation

$pSheet

\PHPExcel_Worksheet

Worksheet

$resetLog

boolean

Flag indicating whether calculation log should be reset or not

Exceptions

\PHPExcel_Calculation_Exception

Returns

mixedArray of values in range if range contains more than one element. Otherwise, a single value is returned.

Flush the calculation cache for any existing instance of this class but only if a PHPExcel_Calculation instance exists

flushInstance() : null
access public

Returns

null

Return the Array Return Type (Array or Value of first element in the array)

getArrayReturnType() : string
Static
access public

Returns

string$returnType Array return type

Is calculation caching enabled?

getCalculationCacheEnabled() : boolean
access public

Returns

boolean

Get the debuglog for this claculation engine instance

getDebugLog() : \PHPExcel_CalcEngine_Logger
access public

Returns

Return the locale-specific translation of FALSE

getFALSE() : string
Static
access public

Returns

stringlocale-specific translation of FALSE

Get an instance of this class

getInstance(\PHPExcel $workbook) : \PHPExcel_Calculation
Static
access public

Parameters

$workbook

\PHPExcel

Injected workbook for working with a PHPExcel object, or NULL to create a standalone claculation engine

Returns

Get the currently defined locale code

getLocale() : string

Returns

string

Return the locale-specific translation of TRUE

getTRUE() : string
Static
access public

Returns

stringlocale-specific translation of TRUE

getValueFromCache()

getValueFromCache($worksheetName, $cellID, $cellValue) 

Parameters

$worksheetName

$cellID

$cellValue

Is a specific function implemented?

isImplemented(string $pFunction) : boolean

Parameters

$pFunction

string

Function Name

Returns

boolean

Get a list of all Excel function names

listAllFunctionNames() : array

Returns

array

Get a list of implemented Excel function names

listFunctionNames() : array

Returns

array

Get a list of all implemented functions as an array of function objects

listFunctions() : array

Returns

arrayof PHPExcel_Calculation_Function

Validate and parse a formula string

parseFormula(string $formula) : array

Parameters

$formula

string

Formula to parse

Exceptions

\PHPExcel_Calculation_Exception

Returns

array

Rename calculation cache for a specified worksheet

renameCalculationCacheForWorksheet(string $fromWorksheetName, string $toWorksheetName) 

Parameters

$fromWorksheetName

string

$toWorksheetName

string

saveValueToCache()

saveValueToCache($worksheetName, $cellID, $cellValue) 

Parameters

$worksheetName

$cellID

$cellValue

Set the Array Return Type (Array or Value of first element in the array)

setArrayReturnType(string $returnType) : boolean
Static
access public

Parameters

$returnType

string

Array return type

Returns

booleanSuccess or failure

Enable/disable calculation cache

setCalculationCacheEnabled(boolean $pValue) 
access public

Parameters

$pValue

boolean

Set the locale code

setLocale(string $locale) : boolean

Parameters

$locale

string

The locale to use for formula translation

Returns

boolean

Unset an instance of this class

unsetInstance(\PHPExcel $workbook) 
Static
access public

Parameters

$workbook

\PHPExcel

Injected workbook identifying the instance to unset

 Properties

 

$_localeBoolean : string[]
 

$cyclicFormulaCount : integer
 

$formulaError : string
access public
 

$suppressFormulaErrors : boolean
access public
                                                     

 Constants

 

CALCULATION_REGEXP_CELLREF

CALCULATION_REGEXP_CELLREF 
 

CALCULATION_REGEXP_ERROR

CALCULATION_REGEXP_ERROR 
 

CALCULATION_REGEXP_FUNCTION

CALCULATION_REGEXP_FUNCTION 
 

CALCULATION_REGEXP_NAMEDRANGE

CALCULATION_REGEXP_NAMEDRANGE 
 

CALCULATION_REGEXP_NUMBER

CALCULATION_REGEXP_NUMBER 
 

CALCULATION_REGEXP_OPENBRACE

CALCULATION_REGEXP_OPENBRACE 
 

CALCULATION_REGEXP_STRING

CALCULATION_REGEXP_STRING 
 

RETURN_ARRAY_AS_ARRAY

RETURN_ARRAY_AS_ARRAY 
 

constants

RETURN_ARRAY_AS_ERROR 
 

RETURN_ARRAY_AS_VALUE

RETURN_ARRAY_AS_VALUE