category |
Zend |
package |
Zend_Validate |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
inherited_from |
\Zend_Validate_Abstract |
Methods
Sets validator options
Accepts the following option keys:
'min' => scalar, minimum border
'max' => scalar, maximum border
'inclusive' => boolean, inclusive border values
__construct(array|\Zend_Config $options)
Parameters
$options
array
\Zend_Config
Exceptions
Magic function returns the value of the requested property, if and only if it is the value or a
message variable.
__get(string $property) : mixed
Inherited
Parameters
$property
string
Exceptions
Returns
mixed
Get default translation object for all validate objects
getDefaultTranslator() : \Zend_Translate_Adapter | null
InheritedStatic
Returns
\Zend_Translate_Adapter
null
Returns array of validation failure message codes
getErrors() : array
Inherited
Returns the inclusive option
getInclusive() : boolean
Returns the max option
getMax() : mixed
Returns the maximum allowed message length
getMessageLength() : integer
InheritedStatic
Returns the message templates from the validator
getMessageTemplates() : array
Inherited
Returns an array of the names of variables that are used in constructing validation failure messages
getMessageVariables() : array
Inherited
Returns array of validation failure messages
getMessages() : array
Inherited
If isValid() was never called or if the most recent isValid() call
returned true, then this method returns an empty array.
inherited_from |
\Zend_Validate_Interface::getMessages() |
Returns
array
Returns the min option
getMin() : mixed
Retrieve flag indicating whether or not value should be obfuscated in
messages
getObscureValue() : boolean
Inherited
Return translation object
getTranslator() : \Zend_Translate_Adapter | null
Inherited
Returns
\Zend_Translate_Adapter
null
Is there a default translation object set?
hasDefaultTranslator() : boolean
InheritedStatic
Does this validator have its own specific translator?
hasTranslator() : boolean
Inherited
Defined by Zend_Validate_Interface
isValid(mixed $value) : boolean
Returns true if and only if $value is between min and max options, inclusively
if inclusive option is true.
Parameters
$value
mixed
Returns
boolean
Set default translation object for all validate objects
setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
)
InheritedStatic
Parameters
$translator
\Zend_Translate
\Zend_Translate_Adapter
null
Exceptions
Indicate whether or not translation should be disabled
setDisableTranslator(boolean $flag) : \Zend_Validate_Abstract
Inherited
Parameters
$flag
boolean
Returns
\Zend_Validate_Abstract
Sets the inclusive option
setInclusive(boolean $inclusive) : \Zend_Validate_Between
Parameters
$inclusive
boolean
Returns
\Zend_Validate_Between
Provides a fluent interface
Sets the max option
setMax(mixed $max) : \Zend_Validate_Between
Parameters
$max
mixed
Returns
\Zend_Validate_Between
Provides a fluent interface
Sets the validation failure message template for a particular key
setMessage(string $messageString, string $messageKey = null
) : \Zend_Validate_Abstract
Inherited
Parameters
$messageString
string
$messageKey
string
OPTIONAL
Exceptions
Returns
\Zend_Validate_Abstract
Provides a fluent interface
Sets the maximum allowed message length
setMessageLength(integer $length = -1
)
InheritedStatic
Parameters
$length
integer
Sets validation failure message templates given as an array, where the array keys are the message keys,
and the array values are the message template strings.
setMessages(array $messages) : \Zend_Validate_Abstract
Inherited
Parameters
$messages
array
Returns
\Zend_Validate_Abstract
Sets the min option
setMin(mixed $min) : \Zend_Validate_Between
Parameters
$min
mixed
Returns
\Zend_Validate_Between
Provides a fluent interface
Set flag indicating whether or not value should be obfuscated in messages
setObscureValue(boolean $flag) : \Zend_Validate_Abstract
Inherited
Parameters
$flag
boolean
Returns
\Zend_Validate_Abstract
Set translation object
setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
) : \Zend_Validate_Abstract
Inherited
Parameters
$translator
\Zend_Translate
\Zend_Translate_Adapter
null
Exceptions
Returns
\Zend_Validate_Abstract
Is translation disabled?
translatorIsDisabled() : boolean
Inherited
Constructs and returns a validation failure message with the given message key and value.
_createMessage(string $messageKey, string $value) : string
Inherited
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.
Parameters
$messageKey
string
$value
string
Returns
string
_error()
_error(string $messageKey, string $value = null
) : void
Inherited
Parameters
$messageKey
string
Joins elements of a multidimensional array
_implodeRecursive(array $pieces) : string
Inherited
Parameters
$pieces
array
Returns
string
Sets the value to be validated and clears the messages and errors arrays
_setValue(mixed $value) : void
Inherited
Properties
Default translation object for all validate objects
$_defaultTranslator : \Zend_Translate
Static
Array of validation failure message codes
$_errors : array
Whether to do inclusive comparisons, allowing equivalence to min and/or max
$_inclusive : boolean
If false, then strict comparisons are done, and the value may equal neither
the min nor max options
Maximum value
$_max : mixed
Limits the maximum returned length of a error message
$_messageLength : Integer
Static
Validation failure message template definitions
$_messageTemplates : array
Default
array(self::NOT_BETWEEN => "'%value%' is not between '%min%' and '%max%', inclusively", self::NOT_BETWEEN_STRICT => "'%value%' is not strictly between '%min%' and '%max%'")
inherited_from |
\Zend_Validate_Abstract::_messageTemplates |
Validation failure message template definitions
$_messageTemplates : array
Additional variables available for validation failure messages
$_messageVariables : array
Default
array('min' => '_min', 'max' => '_max')
inherited_from |
\Zend_Validate_Abstract::_messageVariables |
Additional variables available for validation failure messages
$_messageVariables : array
Array of validation failure messages
$_messages : array
Minimum value
$_min : mixed
Flag indidcating whether or not value should be obfuscated in error
messages
$_obscureValue : boolean
Translation object
$_translator : \Zend_Translate
Is translation disabled?
$_translatorDisabled : Boolean
The value to be validated
$_value : mixed
Constants
Validation failure message key for when the value is not between the min and max, inclusively
NOT_BETWEEN = 'notBetween'
Validation failure message key for when the value is not strictly between the min and max
NOT_BETWEEN_STRICT = 'notBetweenStrict'