TYPO3 CMS  TYPO3_6-2
EqualsValidator.php
Go to the documentation of this file.
1 <?php
3 
23 
29  const LOCALISATION_OBJECT_NAME = 'tx_form_system_validate_equals';
30 
36  protected $field;
37 
43  public function __construct($arguments) {
44  $this->setField($arguments['field']);
45  parent::__construct($arguments);
46  }
47 
54  public function isValid() {
55  if ($this->requestHandler->has($this->fieldName)) {
56  if (!$this->requestHandler->has($this->field)) {
57  return FALSE;
58  } else {
59  $value = $this->requestHandler->getByMethod($this->fieldName);
60  $comparisonValue = $this->requestHandler->getByMethod($this->field);
61  if ($value !== $comparisonValue) {
62  return FALSE;
63  }
64  }
65  }
66  return TRUE;
67  }
68 
75  public function setField($field) {
76  $this->field = (string) $field;
77  return $this;
78  }
79 
87  protected function substituteValues($message) {
88  $message = str_replace('%field', $this->field, $message);
89  return $message;
90  }
91 
92 }