Validator for the image size of a image file
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 |
__construct(\Zend_Config|array $options)
Accepts the following option keys:
\Zend_Config
array
\Zend_Validate_Exception |
---|
__get(string $property) : mixed
string
\Zend_Validate_Exception |
---|
mixed
getDefaultTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
getErrors() : array
deprecated | Since 1.5.0 |
---|
array
getImageHeight() : array
array
getImageMax() : array
array
getImageMin() : array
array
getImageWidth() : array
array
getMessageLength() : integer
integer
getMessageTemplates() : array
array
getMessageVariables() : array
array
getMessages() : array
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() |
---|
array
getObscureValue() : boolean
boolean
getTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
hasDefaultTranslator() : boolean
boolean
hasTranslator() : boolean
boolean
isValid(string $value, array $file = null
) : boolean
Returns true if and only if the imagesize of $value is at least min and not bigger than max
string
Real file to check for image size
array
File data from Zend_File_Transfer
boolean
setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
)
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Validate_Exception |
---|
setDisableTranslator(boolean $flag) : \Zend_Validate_Abstract
boolean
\Zend_Validate_Abstract
setImageHeight(array $options) : \Zend_Validate_File_ImageSize
array
The image height dimensions
\Zend_Validate_File_ImageSize
Provides a fluent interfacesetImageMax(array $options) : \Zend_Validate_StringLength
array
The maximum image dimensions
\Zend_Validate_Exception |
When maxwidth is smaller than minwidth |
---|---|
\Zend_Validate_Exception |
When maxheight is smaller than minheight |
\Zend_Validate_StringLength
Provides a fluent interfacesetImageMin(array $options) : \Zend_Validate_File_ImageSize
array
The minimum image dimensions
\Zend_Validate_Exception |
When minwidth is greater than maxwidth |
---|---|
\Zend_Validate_Exception |
When minheight is greater than maxheight |
\Zend_Validate_File_ImageSize
Provides a fluent interfacesetImageWidth(array $options) : \Zend_Validate_File_ImageSize
array
The image width dimensions
\Zend_Validate_File_ImageSize
Provides a fluent interfacesetMessage(string $messageString, string $messageKey = null
) : \Zend_Validate_Abstract
string
string
OPTIONAL
\Zend_Validate_Exception |
---|
\Zend_Validate_Abstract
Provides a fluent interfacesetMessageLength(integer $length = -1
)
integer
setMessages(array $messages) : \Zend_Validate_Abstract
array
\Zend_Validate_Abstract
setObscureValue(boolean $flag) : \Zend_Validate_Abstract
boolean
\Zend_Validate_Abstract
setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
) : \Zend_Validate_Abstract
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Validate_Exception |
---|
\Zend_Validate_Abstract
translatorIsDisabled() : boolean
boolean
_createMessage(string $messageKey, string $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
string
string
_error(string $messageKey, string $value = null
) : void
string
string
OPTIONAL
_implodeRecursive(array $pieces) : string
array
string
_setValue(mixed $value) : void
mixed
_throw(string $file, string $errorType) : false
string
string
false
$_defaultTranslator : \Zend_Translate
$_errors : array
array()
deprecated | Since 1.5.0 |
---|
$_height : integer
$_maxheight : integer
$_maxwidth : integer
$_minheight : integer
$_minwidth : integer
$_obscureValue : boolean
false
$_translator : \Zend_Translate
$_translatorDisabled : Boolean
false
$_value : mixed
$_width : integer
HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig'
HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall'
NOT_DETECTED = 'fileImageSizeNotDetected'
NOT_READABLE = 'fileImageSizeNotReadable'
WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig'
const | string Error constants |
---|
WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall'