\Zend_Validate_File_ImageSize
Validator for the image size of a image file
- Copyright: Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Validate_File_ImageSize
extends Zend_Validate_Abstract
{
- // constants
- const WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig';
- const WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall';
- const HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig';
- const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall';
- const NOT_DETECTED = 'fileImageSizeNotDetected';
- const NOT_READABLE = 'fileImageSizeNotReadable';
- // members
- protected array $_messageTemplates = ;
- protected array $_messageVariables = ;
- protected $_minwidth;
- protected $_maxwidth;
- protected $_minheight;
- protected $_maxheight;
- // Inherited members from Zend_Validate_Abstract
- protected $_value;
- protected array $_messageVariables;
- protected array $_messageTemplates;
- protected array $_messages;
- protected bool $_obscureValue;
- protected array $_errors;
- protected Zend_Translate $_translator;
- protected static Zend_Translate $_defaultTranslator;
- // methods
- public void __construct()
- public array getImageMin()
- public array getImageMax()
- public array getImageWidth()
- public array getImageHeight()
- public Zend_Validate_File_ImageSize setImageMin()
- public Zend_Validate_StringLength setImageMax()
- public Zend_Validate_File_ImageSize setImageWidth()
- public Zend_Validate_File_ImageSize setImageHeight()
- public boolean isValid()
- protected false _throw()
- // Inherited methods from Zend_Validate_Abstract
- public array getMessages()
- public array getMessageVariables()
- public Zend_Validate_Abstract setMessage()
- public Zend_Validate_Abstract setMessages()
- public mixed __get()
- protected string _createMessage()
- protected void _error()
- protected void _setValue()
- public array getErrors()
- public Zend_Validate_Abstract setObscureValue()
- public bool getObscureValue()
- public Zend_Validate_Abstract setTranslator()
- public Zend_Translate_Adapter|null getTranslator()
- public static void setDefaultTranslator()
- public static Zend_Translate_Adapter|null getDefaultTranslator()
Hierarchy
Extends
Constants
Name | Value |
---|---|
WIDTH_TOO_BIG | 'fileImageSizeWidthTooBig' |
WIDTH_TOO_SMALL | 'fileImageSizeWidthTooSmall' |
HEIGHT_TOO_BIG | 'fileImageSizeHeightTooBig' |
HEIGHT_TOO_SMALL | 'fileImageSizeHeightTooSmall' |
NOT_DETECTED | 'fileImageSizeNotDetected' |
NOT_READABLE | 'fileImageSizeNotReadable' |
Members
protected
- $_defaultTranslator
—
Zend_Translate
Default translation object for all validate objects - $_errors
—
array
Array of validation failure message codes - $_maxheight
—
integer
Maximum image height - $_maxwidth
—
integer
Maximum image width - $_messageTemplates — array
- $_messageTemplates
—
array
Validation failure message template definitions - $_messageVariables — array
- $_messageVariables
—
array
Additional variables available for validation failure messages - $_messages
—
array
Array of validation failure messages - $_minheight
—
integer
Minimum image height - $_minwidth
—
integer
Minimum image width - $_obscureValue
—
bool
Flag indidcating whether or not value should be obfuscated in error messages - $_translator
—
Zend_Translate
Translation object - $_value
—
mixed
The value to be validated
Methods
protected
- _throw() — Throws an error of the given type
public
- __construct() — Sets validator options
- getImageHeight() — Returns the set image height sizes
- getImageMax() — Returns the set maximum image sizes
- getImageMin() — Returns the set minimum image sizes
- getImageWidth() — Returns the set image width sizes
- isValid() — Defined by Zend_Validate_Interface
- setImageHeight() — Sets the mimimum and maximum image height
- setImageMax() — Sets the maximum image size
- setImageMin() — Sets the minimum image size
- setImageWidth() — Sets the mimimum and maximum image width
Inherited from Zend_Validate_Abstract
protected
- _createMessage() — Constructs and returns a validation failure message with the given message key and value.
- _error()
- _setValue() — Sets the value to be validated and clears the messages and errors arrays
public
- __get() — Magic function returns the value of the requested property, if and only if it is the value or a message variable.
- getDefaultTranslator() — Get default translation object for all validate objects
- getErrors() — Returns array of validation failure message codes
- getMessageVariables() — Returns an array of the names of variables that are used in constructing validation failure messages
- getMessages() — Returns array of validation failure messages
- getObscureValue() — Retrieve flag indicating whether or not value should be obfuscated in messages
- getTranslator() — Return translation object
- setDefaultTranslator() — Set default translation object for all validate objects
- setMessage() — Sets the validation failure message template for a particular key
- setMessages() — 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.
- setObscureValue() — Set flag indicating whether or not value should be obfuscated in messages
- setTranslator() — Set translation object