ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DataValidation.php
Go to the documentation of this file.
1 <?php
37 {
38  /* Data validation types */
39  const TYPE_NONE = 'none';
40  const TYPE_CUSTOM = 'custom';
41  const TYPE_DATE = 'date';
42  const TYPE_DECIMAL = 'decimal';
43  const TYPE_LIST = 'list';
44  const TYPE_TEXTLENGTH = 'textLength';
45  const TYPE_TIME = 'time';
46  const TYPE_WHOLE = 'whole';
47 
48  /* Data validation error styles */
49  const STYLE_STOP = 'stop';
50  const STYLE_WARNING = 'warning';
51  const STYLE_INFORMATION = 'information';
52 
53  /* Data validation operators */
54  const OPERATOR_BETWEEN = 'between';
55  const OPERATOR_EQUAL = 'equal';
56  const OPERATOR_GREATERTHAN = 'greaterThan';
57  const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual';
58  const OPERATOR_LESSTHAN = 'lessThan';
59  const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual';
60  const OPERATOR_NOTBETWEEN = 'notBetween';
61  const OPERATOR_NOTEQUAL = 'notEqual';
62 
68  private $_formula1;
69 
75  private $_formula2;
76 
83 
90 
96  private $_operator;
97 
103  private $_allowBlank;
104 
110  private $_showDropDown;
111 
118 
125 
131  private $_errorTitle;
132 
138  private $_error;
139 
145  private $_promptTitle;
146 
152  private $_prompt;
153 
157  public function __construct()
158  {
159  // Initialise member variables
160  $this->_formula1 = '';
161  $this->_formula2 = '';
163  $this->_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
164  $this->_operator = '';
165  $this->_allowBlank = FALSE;
166  $this->_showDropDown = FALSE;
167  $this->_showInputMessage = FALSE;
168  $this->_showErrorMessage = FALSE;
169  $this->_errorTitle = '';
170  $this->_error = '';
171  $this->_promptTitle = '';
172  $this->_prompt = '';
173  }
174 
180  public function getFormula1() {
181  return $this->_formula1;
182  }
183 
190  public function setFormula1($value = '') {
191  $this->_formula1 = $value;
192  return $this;
193  }
194 
200  public function getFormula2() {
201  return $this->_formula2;
202  }
203 
210  public function setFormula2($value = '') {
211  $this->_formula2 = $value;
212  return $this;
213  }
214 
220  public function getType() {
221  return $this->_type;
222  }
223 
231  $this->_type = $value;
232  return $this;
233  }
234 
240  public function getErrorStyle() {
241  return $this->_errorStyle;
242  }
243 
251  $this->_errorStyle = $value;
252  return $this;
253  }
254 
260  public function getOperator() {
261  return $this->_operator;
262  }
263 
270  public function setOperator($value = '') {
271  $this->_operator = $value;
272  return $this;
273  }
274 
280  public function getAllowBlank() {
281  return $this->_allowBlank;
282  }
283 
290  public function setAllowBlank($value = false) {
291  $this->_allowBlank = $value;
292  return $this;
293  }
294 
300  public function getShowDropDown() {
301  return $this->_showDropDown;
302  }
303 
310  public function setShowDropDown($value = false) {
311  $this->_showDropDown = $value;
312  return $this;
313  }
314 
320  public function getShowInputMessage() {
322  }
323 
330  public function setShowInputMessage($value = false) {
331  $this->_showInputMessage = $value;
332  return $this;
333  }
334 
340  public function getShowErrorMessage() {
342  }
343 
350  public function setShowErrorMessage($value = false) {
351  $this->_showErrorMessage = $value;
352  return $this;
353  }
354 
360  public function getErrorTitle() {
361  return $this->_errorTitle;
362  }
363 
370  public function setErrorTitle($value = '') {
371  $this->_errorTitle = $value;
372  return $this;
373  }
374 
380  public function getError() {
381  return $this->_error;
382  }
383 
390  public function setError($value = '') {
391  $this->_error = $value;
392  return $this;
393  }
394 
400  public function getPromptTitle() {
401  return $this->_promptTitle;
402  }
403 
410  public function setPromptTitle($value = '') {
411  $this->_promptTitle = $value;
412  return $this;
413  }
414 
420  public function getPrompt() {
421  return $this->_prompt;
422  }
423 
430  public function setPrompt($value = '') {
431  $this->_prompt = $value;
432  return $this;
433  }
434 
440  public function getHashCode() {
441  return md5(
442  $this->_formula1
443  . $this->_formula2
445  . $this->_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP
446  . $this->_operator
447  . ($this->_allowBlank ? 't' : 'f')
448  . ($this->_showDropDown ? 't' : 'f')
449  . ($this->_showInputMessage ? 't' : 'f')
450  . ($this->_showErrorMessage ? 't' : 'f')
451  . $this->_errorTitle
452  . $this->_error
453  . $this->_promptTitle
454  . $this->_prompt
455  . __CLASS__
456  );
457  }
458 
462  public function __clone() {
463  $vars = get_object_vars($this);
464  foreach ($vars as $key => $value) {
465  if (is_object($value)) {
466  $this->$key = clone $value;
467  } else {
468  $this->$key = $value;
469  }
470  }
471  }
472 }
getErrorStyle()
Get Error style.
getErrorTitle()
Get Error title.
getShowErrorMessage()
Get Show ErrorMessage.
setError($value='')
Set Error.
setShowDropDown($value=false)
Set Show DropDown.
setFormula2($value='')
Set Formula 2.
setShowInputMessage($value=false)
Set Show InputMessage.
setType($value=PHPExcel_Cell_DataValidation::TYPE_NONE)
Set Type.
__construct()
Create a new PHPExcel_Cell_DataValidation.
setOperator($value='')
Set Operator.
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
setFormula1($value='')
Set Formula 1.
setShowErrorMessage($value=false)
Set Show ErrorMessage.
setPromptTitle($value='')
Set Prompt title.
getPromptTitle()
Get Prompt title.
getAllowBlank()
Get Allow Blank.
setPrompt($value='')
Set Prompt.
setErrorTitle($value='')
Set Error title.
getShowInputMessage()
Get Show InputMessage.
getShowDropDown()
Get Show DropDown.
$key
Definition: croninfo.php:18
setErrorStyle($value=PHPExcel_Cell_DataValidation::STYLE_STOP)
Set Error style.
setAllowBlank($value=false)
Set Allow Blank.