Source for file NamedRange.php
Documentation is available at NamedRange.php
* Copyright (c) 2006 - 2009 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
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
/** PHPExcel root directory */
define('PHPEXCEL_ROOT', dirname(__FILE__ ) . '/../');
require_once PHPEXCEL_ROOT . 'PHPExcel.php';
/** PHPExcel_Worksheet */
require_once PHPEXCEL_ROOT . 'PHPExcel/Worksheet.php';
/** PHPExcel_ReferenceHelper */
require_once PHPEXCEL_ROOT . 'PHPExcel/ReferenceHelper.php';
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* Worksheet on which the named range can be resolved
* @var PHPExcel_Worksheet
* Range of the referenced cells
* Is the named range local? (i.e. can only be used on $this->_worksheet)
* Create a new NamedRange
* @param PHPExcel_Worksheet $pWorksheet
* @param bool $pLocalOnly
public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false)
throw new Exception('Parameters can not be null.');
* @return PHPExcel_NamedRange
public function setName($value = null) {
$oldTitle = $this->_name;
$this->_worksheet->getParent()->addNamedRange($this);
$newTitle = $this->_name;
* @return PHPExcel_Worksheet
* @param PHPExcel_Worksheet $value
* @return PHPExcel_NamedRange
public function setWorksheet(PHPExcel_Worksheet $value = null) {
* @return PHPExcel_NamedRange
public function setRange($value = null) {
* @return PHPExcel_NamedRange
* Resolve a named range to a regular cell range
* @param string $pNamedRange Named range
* @param PHPExcel_Worksheet $pSheet Worksheet
* @return PHPExcel_NamedRange
public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) {
return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet);
* Implement PHP __clone to create a deep clone, not just a shallow copy.
foreach ($vars as $key => $value) {
$this->$key = clone $value;
|