TYPO3 CMS  TYPO3_6-2
DisjunctionValidator.php
Go to the documentation of this file.
1 <?php
3 
23 
35  public function validate($value) {
36  $validators = $this->getValidators();
37  if ($validators->count() > 0) {
38  $result = NULL;
39  foreach ($validators as $validator) {
40  $validatorResult = $validator->validate($value);
41  if ($validatorResult->hasErrors()) {
42  if ($result === NULL) {
43  $result = $validatorResult;
44  } else {
45  $result->merge($validatorResult);
46  }
47  } else {
48  if ($result === NULL) {
49  $result = $validatorResult;
50  } else {
51  $result->clear();
52  }
53  break;
54  }
55  }
56  } else {
57  $result = new \TYPO3\CMS\Extbase\Error\Result();
58  }
59 
60  return $result;
61  }
62 
72  public function isValid($value) {
73  $result = FALSE;
74  foreach ($this->validators as $validator) {
75  if ($validator->isValid($value) === FALSE) {
76  $this->errors = array_merge($this->errors, $validator->getErrors());
77  } else {
78  $result = TRUE;
79  }
80  }
81  if ($result === TRUE) {
82  $this->errors = array();
83  }
84  return $result;
85  }
86 }
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.