ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
DataValidation.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
7  // Data validation types
8  const TYPE_NONE = 'none';
9  const TYPE_CUSTOM = 'custom';
10  const TYPE_DATE = 'date';
11  const TYPE_DECIMAL = 'decimal';
12  const TYPE_LIST = 'list';
13  const TYPE_TEXTLENGTH = 'textLength';
14  const TYPE_TIME = 'time';
15  const TYPE_WHOLE = 'whole';
16 
17  // Data validation error styles
18  const STYLE_STOP = 'stop';
19  const STYLE_WARNING = 'warning';
20  const STYLE_INFORMATION = 'information';
21 
22  // Data validation operators
23  const OPERATOR_BETWEEN = 'between';
24  const OPERATOR_EQUAL = 'equal';
25  const OPERATOR_GREATERTHAN = 'greaterThan';
26  const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual';
27  const OPERATOR_LESSTHAN = 'lessThan';
28  const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual';
29  const OPERATOR_NOTBETWEEN = 'notBetween';
30  const OPERATOR_NOTEQUAL = 'notEqual';
31 
37  private $formula1 = '';
38 
44  private $formula2 = '';
45 
51  private $type = self::TYPE_NONE;
52 
58  private $errorStyle = self::STYLE_STOP;
59 
65  private $operator = self::OPERATOR_BETWEEN;
66 
72  private $allowBlank = false;
73 
79  private $showDropDown = false;
80 
86  private $showInputMessage = false;
87 
93  private $showErrorMessage = false;
94 
100  private $errorTitle = '';
101 
107  private $error = '';
108 
114  private $promptTitle = '';
115 
121  private $prompt = '';
122 
126  public function __construct()
127  {
128  }
129 
135  public function getFormula1()
136  {
137  return $this->formula1;
138  }
139 
147  public function setFormula1($value)
148  {
149  $this->formula1 = $value;
150 
151  return $this;
152  }
153 
159  public function getFormula2()
160  {
161  return $this->formula2;
162  }
163 
171  public function setFormula2($value)
172  {
173  $this->formula2 = $value;
174 
175  return $this;
176  }
177 
183  public function getType()
184  {
185  return $this->type;
186  }
187 
195  public function setType($value)
196  {
197  $this->type = $value;
198 
199  return $this;
200  }
201 
207  public function getErrorStyle()
208  {
209  return $this->errorStyle;
210  }
211 
219  public function setErrorStyle($value)
220  {
221  $this->errorStyle = $value;
222 
223  return $this;
224  }
225 
231  public function getOperator()
232  {
233  return $this->operator;
234  }
235 
243  public function setOperator($value)
244  {
245  $this->operator = $value;
246 
247  return $this;
248  }
249 
255  public function getAllowBlank()
256  {
257  return $this->allowBlank;
258  }
259 
267  public function setAllowBlank($value)
268  {
269  $this->allowBlank = $value;
270 
271  return $this;
272  }
273 
279  public function getShowDropDown()
280  {
281  return $this->showDropDown;
282  }
283 
291  public function setShowDropDown($value)
292  {
293  $this->showDropDown = $value;
294 
295  return $this;
296  }
297 
303  public function getShowInputMessage()
304  {
306  }
307 
315  public function setShowInputMessage($value)
316  {
317  $this->showInputMessage = $value;
318 
319  return $this;
320  }
321 
327  public function getShowErrorMessage()
328  {
330  }
331 
339  public function setShowErrorMessage($value)
340  {
341  $this->showErrorMessage = $value;
342 
343  return $this;
344  }
345 
351  public function getErrorTitle()
352  {
353  return $this->errorTitle;
354  }
355 
363  public function setErrorTitle($value)
364  {
365  $this->errorTitle = $value;
366 
367  return $this;
368  }
369 
375  public function getError()
376  {
377  return $this->error;
378  }
379 
387  public function setError($value)
388  {
389  $this->error = $value;
390 
391  return $this;
392  }
393 
399  public function getPromptTitle()
400  {
401  return $this->promptTitle;
402  }
403 
411  public function setPromptTitle($value)
412  {
413  $this->promptTitle = $value;
414 
415  return $this;
416  }
417 
423  public function getPrompt()
424  {
425  return $this->prompt;
426  }
427 
435  public function setPrompt($value)
436  {
437  $this->prompt = $value;
438 
439  return $this;
440  }
441 
447  public function getHashCode()
448  {
449  return md5(
450  $this->formula1 .
451  $this->formula2 .
452  $this->type .
453  $this->errorStyle .
454  $this->operator .
455  ($this->allowBlank ? 't' : 'f') .
456  ($this->showDropDown ? 't' : 'f') .
457  ($this->showInputMessage ? 't' : 'f') .
458  ($this->showErrorMessage ? 't' : 'f') .
459  $this->errorTitle .
460  $this->error .
461  $this->promptTitle .
462  $this->prompt .
463  __CLASS__
464  );
465  }
466 
470  public function __clone()
471  {
472  $vars = get_object_vars($this);
473  foreach ($vars as $key => $value) {
474  if (is_object($value)) {
475  $this->$key = clone $value;
476  } else {
477  $this->$key = $value;
478  }
479  }
480  }
481 }
setShowInputMessage($value)
Set Show InputMessage.
__construct()
Create a new DataValidation.
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
setShowErrorMessage($value)
Set Show ErrorMessage.
$key
Definition: croninfo.php:18