PHPExcel_Calculation
[ class tree: PHPExcel_Calculation ] [ index: PHPExcel_Calculation ] [ all elements ]

Class: PHPExcel_Calculation

Source Location: /PHPExcel/Calculation.php

Class Overview


PHPExcel_Calculation (Singleton)


Author(s):

Copyright:

  • Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)

Variables

Constants

Methods



Class Details

[line 56]
PHPExcel_Calculation (Singleton)



Tags:

copyright:  Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)


[ Top ]


Class Variables

$cyclicFormulaCount =  0

[line 187]



Tags:

access:  public

Type:   mixed


[ Top ]

$debugLog = array()

[line 184]

The debug log generated by the calculation engine



Tags:

var:  of string
access:  public

Type:   array


[ Top ]

$formulaError =  null

[line 155]

Error message for any error that was raised/thrown by the calculation engine



Tags:

access:  public

Type:   string


[ Top ]

$suppressFormulaErrors =  false

[line 146]

Flag to determine how formula errors should be handled If true, then a user error will be triggered If false, then an exception will be thrown



Tags:

access:  public

Type:   boolean


[ Top ]

$writeDebugLog =  false

[line 166]

Flag to determine whether a debug log should be generated by the calculation engine If true, then a debug log will be generated If false, then a debug log will not be generated



Tags:

access:  public

Type:   boolean


[ Top ]



Class Methods


static method getArrayReturnType [line 1713]

static string getArrayReturnType( )

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



Tags:

return:  Array return type
access:  public


[ Top ]

static method getInstance [line 1669]

static PHPExcel_Calculation getInstance( )

Get an instance of this class



Tags:

access:  public


[ Top ]

static method setArrayReturnType [line 1696]

static boolean setArrayReturnType( string $returnType)

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



Tags:

return:  Success or failure
access:  public


Parameters:

string   $returnType   Array return type

[ Top ]

static method _getMatrixDimensions [line 2314]

static array _getMatrixDimensions( mixed &$matrix)

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



Tags:

return:  An array comprising the number of rows, and number of columns
access:  public


Parameters:

mixed   &$matrix   matrix operand

[ Top ]

static method _localeFunc [line 1978]

static void _localeFunc( $function)



Tags:

access:  public


Parameters:

   $function  

[ Top ]

static method _translateSeparator [line 1874]

static void _translateSeparator( $fromSeparator, $toSeparator, $formula, &$inBraces)



Tags:

access:  public


Parameters:

   $fromSeparator  
   $toSeparator  
   $formula  
   &$inBraces  

[ Top ]

static method _unwrapResult [line 2023]

static mixed _unwrapResult( mixed $value)

Remove quotes used as a wrapper to identify string values



Tags:

access:  public


Parameters:

mixed   $value  

[ Top ]

static method _wrapResult [line 1999]

static mixed _wrapResult( mixed $value)

Wrap string values in quotes



Tags:

access:  public


Parameters:

mixed   $value  

[ Top ]

method calculate [line 2047]

mixed calculate( [ $pCell = null])

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



Tags:

throws:  Exception
access:  public


Parameters:

PHPExcel_Cell   $pCell   Cell to calculate

[ Top ]

method calculateCellValue [line 2065]

mixed calculateCellValue( [ $pCell = null], [Boolean $resetLog = true])

Calculate the value of a cell formula



Tags:

throws:  Exception
access:  public


Parameters:

PHPExcel_Cell   $pCell   Cell to calculate
Boolean   $resetLog   Flag indicating whether the debug log should be reset or not

[ Top ]

method calculateFormula [line 2150]

mixed calculateFormula( string $formula, [ $cellID = null], [ $pCell = null])

Calculate the value of a formula



Tags:

throws:  Exception
access:  public


Parameters:

string   $formula   Formula to parse
   $cellID  
PHPExcel_Cell   $pCell  

[ Top ]

constructor __construct [line 1652]

PHPExcel_Calculation __construct( )



[ Top ]

method clearCalculationCache [line 1760]

void clearCalculationCache( )

Clear calculation cache



Tags:

access:  public


[ Top ]

method disableCalculationCache [line 1752]

void disableCalculationCache( )

Disable calculation cache



Tags:

access:  public


[ Top ]

method enableCalculationCache [line 1744]

void enableCalculationCache( )

Enable calculation cache



Tags:

access:  public


[ Top ]

method extractCellRange [line 3440]

mixed extractCellRange( [string &$pRange = 'A1'], [ $pSheet = null], [ $resetLog = true])

Extract range values



Tags:

return:  Array of values in range if range contains more than one element. Otherwise, a single value is returned.
throws:  Exception
access:  public


Parameters:

string   &$pRange   String based range representation
PHPExcel_Worksheet   $pSheet   Worksheet
   $resetLog  

[ Top ]

method extractNamedRange [line 3495]

mixed extractNamedRange( [string &$pRange = 'A1'], [ $pSheet = null], [ $resetLog = true])

Extract range values



Tags:

return:  Array of values in range if range contains more than one element. Otherwise, a single value is returned.
throws:  Exception
access:  public


Parameters:

string   &$pRange   String based range representation
PHPExcel_Worksheet   $pSheet   Worksheet
   $resetLog  

[ Top ]

method getCalculationCacheEnabled [line 1724]

boolean getCalculationCacheEnabled( )

Is calculation caching enabled?



Tags:

access:  public


[ Top ]

method getCalculationCacheExpirationTime [line 1770]

float getCalculationCacheExpirationTime( )

Get calculation cache expiration time



Tags:

access:  public


[ Top ]

method getLocale [line 1792]

string getLocale( )

Get the currently defined locale code



Tags:

access:  public


[ Top ]

method isImplemented [line 3567]

boolean isImplemented( [string $pFunction = ''])

Is a specific function implemented?



Tags:

access:  public


Parameters:

string   $pFunction   Function Name

[ Top ]

method listFunctionNames [line 3605]

array listFunctionNames( )

Get a list of implemented Excel function names



Tags:

access:  public


[ Top ]

method listFunctions [line 3582]

array listFunctions( )

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



Tags:

return:  of PHPExcel_Calculation_Function
access:  public


[ Top ]

method parseFormula [line 2129]

array parseFormula( string $formula)

Validate and parse a formula string



Tags:

throws:  Exception
access:  public


Parameters:

string   $formula   Formula to parse

[ Top ]

method setCalculationCacheEnabled [line 1735]

void setCalculationCacheEnabled( [boolean $pValue = true])

Enable/disable calculation cache



Tags:

access:  public


Parameters:

boolean   $pValue  

[ Top ]

method setCalculationCacheExpirationTime [line 1780]

void setCalculationCacheExpirationTime( [float $pValue = 2.5])

Set calculation cache expiration time



Tags:

access:  public


Parameters:

float   $pValue  

[ Top ]

method setLocale [line 1802]

boolean setLocale( [ $locale = 'en_us'])

Set the locale code



Tags:

access:  public


Parameters:

   $locale  

[ Top ]

method _calculateFormulaValue [line 2182]

mixed _calculateFormulaValue( string $formula, [string $cellID = null], [ $pCell = null])

Parse a cell formula and calculate its value



Tags:

throws:  Exception
access:  public


Parameters:

string   $formula   The formula to parse and calculate
string   $cellID   The ID (e.g. A3) of the cell that we are calculating
PHPExcel_Cell   $pCell   Cell to calculate

[ Top ]

method _raiseFormulaError [line 3425]

void _raiseFormulaError( $errorMessage)



Tags:

access:  protected


Parameters:

   $errorMessage  

[ Top ]

method _translateFormulaToEnglish [line 1953]

void _translateFormulaToEnglish( $formula)



Tags:

access:  public


Parameters:

   $formula  

[ Top ]

method _translateFormulaToLocale [line 1924]

void _translateFormulaToLocale( $formula)



Tags:

access:  public


Parameters:

   $formula  

[ Top ]

method __clone [line 1684]

void __clone( )

__clone implementation. Cloning should not be allowed in a Singleton!



Tags:

throws:  Exception
access:  public


[ Top ]


Class Constants

CALCULATION_REGEXP_CELLREF =  '(((\w*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)'

[line 69]


[ Top ]

CALCULATION_REGEXP_ERROR =  '\#[A-Z][A-Z0_\/]*[!\?]?'

[line 73]


[ Top ]

CALCULATION_REGEXP_FUNCTION =  '@?([A-Z][A-Z0-9\.]*)[\s]*\('

[line 67]


[ Top ]

CALCULATION_REGEXP_NAMEDRANGE =  '(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9]*)'

[line 71]


[ Top ]

CALCULATION_REGEXP_NUMBER =  '[-+]?\d*\.?\d+(e[-+]?\d+)?'

[line 61]

Regular Expressions


[ Top ]

CALCULATION_REGEXP_OPENBRACE =  '\('

[line 65]


[ Top ]

CALCULATION_REGEXP_STRING =  '"(?:[^"]|"")*"'

[line 63]


[ Top ]

RETURN_ARRAY_AS_ARRAY =  'array'

[line 79]


[ Top ]

RETURN_ARRAY_AS_ERROR =  'error'

[line 77]

constants


[ Top ]

RETURN_ARRAY_AS_VALUE =  'value'

[line 78]


[ Top ]



Documentation generated on Tue, 01 Jun 2010 17:02:27 +0200 by phpDocumentor 1.4.3