Source for file DataValidation.php
Documentation is available at DataValidation.php
* Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.6, 2011-02-27
* PHPExcel_Cell_DataValidation
* @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
/* Data validation types */
const TYPE_NONE = 'none';
const TYPE_CUSTOM = 'custom';
const TYPE_DATE = 'date';
const TYPE_DECIMAL = 'decimal';
const TYPE_LIST = 'list';
const TYPE_TEXTLENGTH = 'textLength';
const TYPE_TIME = 'time';
const TYPE_WHOLE = 'whole';
/* Data validation error styles */
const STYLE_STOP = 'stop';
const STYLE_WARNING = 'warning';
const STYLE_INFORMATION = 'information';
/* Data validation operators */
const OPERATOR_BETWEEN = 'between';
const OPERATOR_EQUAL = 'equal';
const OPERATOR_GREATERTHAN = 'greaterThan';
const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual';
const OPERATOR_LESSTHAN = 'lessThan';
const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual';
const OPERATOR_NOTBETWEEN = 'notBetween';
const OPERATOR_NOTEQUAL = 'notEqual';
private $_type = PHPExcel_Cell_DataValidation::TYPE_NONE;
private $_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
private $_showInputMessage;
private $_showErrorMessage;
* Create a new PHPExcel_Cell_DataValidation
// Initialise member variables
$this->_allowBlank = false;
$this->_showDropDown = false;
$this->_showInputMessage = false;
$this->_showErrorMessage = false;
$this->_promptTitle = '';
* @return PHPExcel_Cell_DataValidation
$this->_formula1 = $value;
* @return PHPExcel_Cell_DataValidation
$this->_formula2 = $value;
* @return PHPExcel_Cell_DataValidation
public function setType($value = PHPExcel_Cell_DataValidation::TYPE_NONE) {
return $this->_errorStyle;
* @return PHPExcel_Cell_DataValidation
public function setErrorStyle($value = PHPExcel_Cell_DataValidation::STYLE_STOP) {
$this->_errorStyle = $value;
* @return PHPExcel_Cell_DataValidation
$this->_operator = $value;
return $this->_allowBlank;
* @return PHPExcel_Cell_DataValidation
$this->_allowBlank = $value;
return $this->_showDropDown;
* @return PHPExcel_Cell_DataValidation
$this->_showDropDown = $value;
return $this->_showInputMessage;
* @return PHPExcel_Cell_DataValidation
$this->_showInputMessage = $value;
return $this->_showErrorMessage;
* @return PHPExcel_Cell_DataValidation
$this->_showErrorMessage = $value;
return $this->_errorTitle;
* @return PHPExcel_Cell_DataValidation
$this->_errorTitle = $value;
* @return PHPExcel_Cell_DataValidation
return $this->_promptTitle;
* @return PHPExcel_Cell_DataValidation
$this->_promptTitle = $value;
* @return PHPExcel_Cell_DataValidation
* @return string Hash code
. ($this->_allowBlank ? 't' : 'f')
. ($this->_showDropDown ? 't' : 'f')
. ($this->_showInputMessage ? 't' : 'f')
. ($this->_showErrorMessage ? 't' : 'f')
* Implement PHP __clone to create a deep clone, not just a shallow copy.
foreach ($vars as $key => $value) {
$this->$key = clone $value;
|