TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\Validation\Validator\BooleanValidator Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Validation\Validator\BooleanValidator:
TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface

Public Member Functions

 isValid ($value)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 __construct (array $options=[])
 
 validate ($value)
 
 getOptions ()
 

Protected Attributes

 $supportedOptions
 
- Protected Attributes inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 $acceptsEmptyValues = true
 
 $supportedOptions = []
 
 $options = []
 
 $result
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 isValid ($value)
 
 addError ($message, $code, array $arguments=[], $title='')
 
 isEmpty ($value)
 
 translateErrorMessage ($translateKey, $extensionName, $arguments=[])
 

Detailed Description

Validator for boolean values

Definition at line 20 of file BooleanValidator.php.

Member Function Documentation

◆ isValid()

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

Check if $value matches the expectation given to the validator. If it does not match, the function adds an error to the result.

Also testing for '1' (true), '0' and '' (false) because casting varies between tests and actual usage. This makes the validator loose but still keeping functionality.

Parameters
mixed$valueThe value that should be validated
Returns
void

Definition at line 44 of file BooleanValidator.php.

References TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator\addError(), and TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator\translateErrorMessage().

Member Data Documentation

◆ $supportedOptions

TYPO3\CMS\Extbase\Validation\Validator\BooleanValidator::$supportedOptions
protected
Initial value:
= [
'is' => [null, 'Boolean value', 'boolean|string|integer']
]

Definition at line 25 of file BooleanValidator.php.