TYPO3 CMS  TYPO3_6-2
GreaterThanValidator.php
Go to the documentation of this file.
1 <?php
3 
23 
29  const LOCALISATION_OBJECT_NAME = 'tx_form_system_validate_greaterthan';
30 
36  protected $minimum;
37 
43  public function __construct($arguments) {
44  $this->setMinimum($arguments['minimum']);
45  parent::__construct($arguments);
46  }
47 
54  public function isValid() {
55  if ($this->requestHandler->has($this->fieldName)) {
56  $value = (int)$this->requestHandler->getByMethod($this->fieldName);
57  if ($value <= $this->minimum) {
58  return FALSE;
59  }
60  }
61  return TRUE;
62  }
63 
70  public function setMinimum($minimum) {
71  $this->minimum = (int)$minimum;
72  return $this;
73  }
74 
82  protected function substituteValues($message) {
83  $message = str_replace('%minimum', $this->minimum, $message);
84  return $message;
85  }
86 
87 }