TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Validation\Validator\DisjunctionValidator Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Validation\Validator\DisjunctionValidator:
TYPO3\CMS\Extbase\Validation\Validator\AbstractCompositeValidator TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface Tx_Extbase_Validation_Validator_DisjunctionValidator

Public Member Functions

 validate ($value)
 
 isValid ($value)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractCompositeValidator
 __construct (array $options=array())
 
 setOptions (array $options)
 
 getErrors ()
 
 addValidator (\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator)
 
 removeValidator (\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface $validator)
 
 count ()
 
 getValidators ()
 
 getOptions ()
 
 setValidatedInstancesContainer (\SplObjectStorage $validatedInstancesContainer)
 
 canValidate ($object)
 
 isPropertyValid ($object, $propertyName)
 

Additional Inherited Members

- Protected Attributes inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractCompositeValidator
 $supportedOptions = array()
 
 $options = array()
 
 $validators
 
 $validatedInstancesContainer
 
 $errors = array()
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Validator to chain many validators in a disjunction (logical or).

Definition at line 22 of file DisjunctionValidator.php.

Member Function Documentation

◆ isValid()

TYPO3\CMS\Extbase\Validation\Validator\DisjunctionValidator::isValid (   $value)

Checks if the given value is valid according to the validators of the conjunction.

If at least one error occurred, the result is FALSE.

Parameters
mixed$valueThe value that should be validated
Returns
boolean TRUE if the value is valid, FALSE if an error occurred
Deprecated:
since Extbase 1.4.0, will be removed two versions after Extbase 6.1

Definition at line 72 of file DisjunctionValidator.php.

References $result.

◆ validate()

TYPO3\CMS\Extbase\Validation\Validator\DisjunctionValidator::validate (   $value)

Checks if the given value is valid according to the validators of the disjunction.

So only one validator has to be valid, to make the whole disjunction valid. Errors are only returned if all validators failed.

Parameters
mixed$valueThe value that should be validated
Returns

Definition at line 35 of file DisjunctionValidator.php.

References $result, TYPO3\CMS\Extbase\Validation\Validator\AbstractCompositeValidator\$validators, and TYPO3\CMS\Extbase\Validation\Validator\AbstractCompositeValidator\getValidators().