class PHPExcel_ReferenceHelper

PHPExcel_ReferenceHelper (Singleton)

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Constants

REFHELPER_REGEXP_CELLREF

Regular Expressions

REFHELPER_REGEXP_CELLRANGE

REFHELPER_REGEXP_ROWRANGE

REFHELPER_REGEXP_COLRANGE

Methods

getInstance()

Get an instance of this class

static integer
columnSort(string $a, string $b)

Compare two column addresses Intended for use as a Callback function for sorting column addresses by column

static integer
columnReverseSort(string $a, string $b)

Compare two column addresses Intended for use as a Callback function for reverse sorting column addresses by column

static integer
cellSort(string $a, string $b)

Compare two cell addresses Intended for use as a Callback function for sorting cell addresses by column and row

static integer
cellReverseSort(string $a, string $b)

Compare two cell addresses Intended for use as a Callback function for sorting cell addresses by column and row

insertNewBefore(string $pBefore = 'A1', integer $pNumCols, integer $pNumRows, PHPExcel_Worksheet $pSheet = null)

Insert a new column or row, updating all possible related data

string
updateFormulaReferences(string $pFormula = '', int $pBefore = 'A1', int $pNumCols, int $pNumRows, string $sheetName = '')

Update references within formulas

string
updateCellReference(string $pCellRange = 'A1', int $pBefore = 'A1', int $pNumCols, int $pNumRows)

Update cell reference

updateNamedFormulas(PHPExcel $pPhpExcel, string $oldName = '', string $newName = '')

Update named formulas (i.e. containing worksheet references / named ranges)

__clone()

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

Details

at line 58
static PHPExcel_ReferenceHelper getInstance()

Get an instance of this class

at line 82
static integer columnSort(string $a, string $b)

Compare two column addresses Intended for use as a Callback function for sorting column addresses by column

Parameters

string $a First column to test (e.g. 'AA')
string $b Second column to test (e.g. 'Z')

Return Value

integer

at line 95
static integer columnReverseSort(string $a, string $b)

Compare two column addresses Intended for use as a Callback function for reverse sorting column addresses by column

Parameters

string $a First column to test (e.g. 'AA')
string $b Second column to test (e.g. 'Z')

Return Value

integer

at line 108
static integer cellSort(string $a, string $b)

Compare two cell addresses Intended for use as a Callback function for sorting cell addresses by column and row

Parameters

string $a First cell to test (e.g. 'AA1')
string $b Second cell to test (e.g. 'Z1')

Return Value

integer

at line 127
static integer cellReverseSort(string $a, string $b)

Compare two cell addresses Intended for use as a Callback function for sorting cell addresses by column and row

Parameters

string $a First cell to test (e.g. 'AA1')
string $b Second cell to test (e.g. 'Z1')

Return Value

integer

at line 388
insertNewBefore(string $pBefore = 'A1', integer $pNumCols, integer $pNumRows, PHPExcel_Worksheet $pSheet = null)

Insert a new column or row, updating all possible related data

Parameters

string $pBefore Insert before this cell address (e.g. 'A1')
integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
PHPExcel_Worksheet $pSheet The worksheet that we're editing

Exceptions

PHPExcel_Exception

at line 649
string updateFormulaReferences(string $pFormula = '', int $pBefore = 'A1', int $pNumCols, int $pNumRows, string $sheetName = '')

Update references within formulas

Parameters

string $pFormula Formula to update
int $pBefore Insert before this one
int $pNumCols Number of columns to insert
int $pNumRows Number of rows to insert
string $sheetName Worksheet name/title

Return Value

string Updated formula

Exceptions

PHPExcel_Exception

at line 789
string updateCellReference(string $pCellRange = 'A1', int $pBefore = 'A1', int $pNumCols, int $pNumRows)

Update cell reference

Parameters

string $pCellRange Cell range
int $pBefore Insert before this one
int $pNumCols Number of columns to increment
int $pNumRows Number of rows to increment

Return Value

string Updated cell range

Exceptions

PHPExcel_Exception

at line 814
updateNamedFormulas(PHPExcel $pPhpExcel, string $oldName = '', string $newName = '')

Update named formulas (i.e. containing worksheet references / named ranges)

Parameters

PHPExcel $pPhpExcel Object to update
string $oldName Old name (name to replace)
string $newName New name

at line 918
final __clone()

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

Exceptions

PHPExcel_Exception