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

Public Member Functions

 isValid ($value)
 
- Public Member Functions inherited from TYPO3\CMS\Form\Domain\Validator\AbstractValidator
 setRawArgument ($rawArgument)
 
 setFormUtility (FormUtility $formUtility)
 
 substituteMarkers ($message)
 
 getLocalLanguageLabel ($type='')
 
 renderMessage ($message=null, $type=null, $messageType='message')
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 __construct (array $options=[])
 
 validate ($value)
 
 getOptions ()
 

Public Attributes

const LOCALISATION_OBJECT_NAME = 'tx_form_system_validate_required'
 
- Public Attributes inherited from TYPO3\CMS\Form\Domain\Validator\AbstractValidator
const LOCALISATION_OBJECT_NAME = 'tx_form_system_validate'
 
 true
 

Protected Member Functions

 setAllFieldsAreEmpty ($allFieldsAreEmpty=true)
 
 getAllFieldsAreEmpty ()
 
- 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=[])
 

Protected Attributes

 $allFieldsAreEmpty = true
 
- Protected Attributes inherited from TYPO3\CMS\Form\Domain\Validator\AbstractValidator
 $formUtility
 
 $rawArgument
 
 $supportedOptions
 
 $acceptsEmptyValues = false
 
- Protected Attributes inherited from TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
 $acceptsEmptyValues = true
 
 $supportedOptions = []
 
 $options = []
 
 $result
 

Detailed Description

Definition at line 17 of file RequiredValidator.php.

Member Function Documentation

◆ getAllFieldsAreEmpty()

TYPO3\CMS\Form\Domain\Validator\RequiredValidator::getAllFieldsAreEmpty ( )
protected

A helper method for the array_walk_recursive callback in the function isValid(). If the callback detect a empty value, the property allFieldsAreEmpty is set to TRUE.

Returns
bool

Definition at line 98 of file RequiredValidator.php.

References TYPO3\CMS\Form\Domain\Validator\RequiredValidator\$allFieldsAreEmpty.

Referenced by TYPO3\CMS\Form\Domain\Validator\RequiredValidator\isValid().

◆ isValid()

TYPO3\CMS\Form\Domain\Validator\RequiredValidator::isValid (   $value)

Check if $value is valid. If it is not valid, needs to add an error to result.

Parameters
mixed$value
Returns
void

Definition at line 38 of file RequiredValidator.php.

References TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator\addError(), TYPO3\CMS\Form\Domain\Validator\RequiredValidator\getAllFieldsAreEmpty(), and TYPO3\CMS\Form\Domain\Validator\AbstractValidator\renderMessage().

◆ setAllFieldsAreEmpty()

TYPO3\CMS\Form\Domain\Validator\RequiredValidator::setAllFieldsAreEmpty (   $allFieldsAreEmpty = true)
protected

A helper method for the array_walk_recursive callback in the function isValid(). If the callback detect a empty value, the property allFieldsAreEmpty is set to TRUE.

Parameters
bool$allFieldsAreEmpty
Returns
void

Definition at line 85 of file RequiredValidator.php.

References TYPO3\CMS\Form\Domain\Validator\RequiredValidator\$allFieldsAreEmpty.

Member Data Documentation

◆ $allFieldsAreEmpty

TYPO3\CMS\Form\Domain\Validator\RequiredValidator::$allFieldsAreEmpty = true
protected

◆ LOCALISATION_OBJECT_NAME

const TYPO3\CMS\Form\Domain\Validator\RequiredValidator::LOCALISATION_OBJECT_NAME = 'tx_form_system_validate_required'

Definition at line 24 of file RequiredValidator.php.