TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Validation\Validator\NumberRangeValidator Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Validation\Validator\NumberRangeValidator:
TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface Tx_Extbase_Validation_Validator_NumberRangeValidator

Public Member Functions

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

Protected Attributes

 $supportedOptions
 
- Protected Attributes inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 $acceptsEmptyValues = TRUE
 
 $supportedOptions = array()
 
 $options = array()
 
 $errors = array()
 
 $result
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 isValid ($value)
 
 addError ($message, $code, array $arguments=array(), $title='')
 
 isEmpty ($value)
 
 translateErrorMessage ($translateKey, $extensionName, $arguments=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 for general numbers

Definition at line 22 of file NumberRangeValidator.php.

Member Function Documentation

◆ isValid()

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

The given value is valid if it is a number in the specified range.

Parameters
mixed$valueThe value that should be validated
Returns
void
Todo:
: remove this fallback to startRange/endRange in 6.3 when the setOptions() method is removed too
Deprecated:
since Extbase 1.4, will be removed two versions after Extbase 6.1

Definition at line 41 of file NumberRangeValidator.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\NumberRangeValidator::$supportedOptions
protected
Initial value:
= array(
'minimum' => array(0, 'The minimum value to accept', 'integer'),
'maximum' => array(PHP_INT_MAX, 'The maximum value to accept', 'integer'),
'startRange' => array(0, 'The minimum value to accept', 'integer'),
'endRange' => array(PHP_INT_MAX, 'The maximum value to accept', 'integer')
)

Definition at line 27 of file NumberRangeValidator.php.