__construct()
__get()
__invoke()
getDefaultTranslator()
getDefaultTranslatorTextDomain()
getMessageLength()
getMessageTemplates()
getMessageVariables()
getMessages()
getOption()
getOptions()
getTranslator()
getTranslatorTextDomain()
hasDefaultTranslator()
hasTranslator()
isTranslatorEnabled()
isValid()
isValueObscured()
setDefaultTranslator()
setDefaultTranslatorTextDomain()
setMessage()
setMessageLength()
setMessages()
setOptions()
setTranslator()
setTranslatorEnabled()
setTranslatorTextDomain()
setValueObscured()
createMessage()
error()
getValue()
setValue()
translateMessage()
$abstractOptions
$defaultTranslator
$defaultTranslatorTextDomain
$messageLength
$value
__construct(array | \Traversable $options)
Validator() - one or multiple scalar values f.e. Validator($first, $second, $third) - an array f.e. Validator(array($first => 'first', $second => 'second', $third => 'third')) - an instance of Traversable f.e. Validator($config_instance)
array\Traversable
__get(string $property) : mixed
string
\Zend\Validator\Exception\InvalidArgumentException |
---|
mixed
__invoke(mixed $value) : bool
mixed
bool
getDefaultTranslator() : \Zend\Validator\Translator\TranslatorInterface | null
getDefaultTranslatorTextDomain() : string
string
getMessageLength() : int
int
getMessageTemplates() : array
array
getMessageVariables() : array
array
getMessages() : array
The array keys are validation failure message identifiers, and the array values are the corresponding human-readable message strings.
If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.
array
getOption(string $option) : mixed
string
Option to be returned
\Zend\Validator\Exception\InvalidArgumentException |
---|
mixed
Returned optiongetOptions() : array
array
Array with all available optionsgetTranslator() : \Zend\Validator\Translator\TranslatorInterface | null
getTranslatorTextDomain() : string
string
hasDefaultTranslator() : bool
bool
hasTranslator() : bool
bool
isTranslatorEnabled() : bool
bool
isValid(mixed $value) : bool
If $value fails validation, then this method returns false, and getMessages() will return an array of messages that explain why the validation failed.
inherited_from | \Zend\Validator\ValidatorInterface::isValid() |
---|
mixed
\Zend\Validator\Exception\RuntimeException |
If validation of $value is impossible |
---|
bool
isValueObscured() : bool
bool
setDefaultTranslator(\Zend\Validator\Translator\TranslatorInterface $translator, string $textDomain) : void
\Zend\Validator\Translator\TranslatorInterfacenull
string
(optional)
\Zend\Validator\Exception\InvalidArgumentException |
---|
setDefaultTranslatorTextDomain(string $textDomain) : void
string
setMessage(string $messageString, string $messageKey) : \Zend\Validator\AbstractValidator
string
string
OPTIONAL
\Zend\Validator\Exception\InvalidArgumentException |
---|
\Zend\Validator\AbstractValidator
Provides a fluent interfacesetMessageLength(int $length)
int
setMessages(array $messages) : \Zend\Validator\AbstractValidator
setOptions(array | \Traversable $options) : \Zend\Validator\AbstractValidator
array\Traversable
Options to set
\Zend\Validator\Exception\InvalidArgumentException |
If $options is not an array or Traversable |
---|
\Zend\Validator\AbstractValidator
Provides fluid interfacesetTranslator(\Zend\Validator\Translator\TranslatorInterface $translator, string $textDomain) : \Zend\Validator\AbstractValidator
\Zend\Validator\Translator\TranslatorInterfacenull
string
(optional)
\Zend\Validator\Exception\InvalidArgumentException |
---|
setTranslatorEnabled(bool $flag) : \Zend\Validator\AbstractValidator
setTranslatorTextDomain(string $textDomain) : \Zend\Validator\AbstractValidator
setValueObscured(bool $flag) : \Zend\Validator\AbstractValidator
createMessage(string $messageKey, string | array | object $value) : string
Returns null if and only if $messageKey does not correspond to an existing template.
If a translator is available and a translation exists for $messageKey, the translation will be used.
string
stringarrayobject
string
error(string $messageKey, string $value) : void
string
string
OPTIONAL
getValue() : mixed
mixed
Value to be validatedsetValue(mixed $value) : void
mixed
translateMessage(string $messageKey, string $message) : string
string
string
string
$abstractOptions
$defaultTranslator : \Zend\Validator\Translator\TranslatorInterface
$defaultTranslatorTextDomain : string
$value : mixed